Upload Qwen_Qwen3-4B-Instruct-2507_1.py with huggingface_hub
Browse files
    	
        Qwen_Qwen3-4B-Instruct-2507_1.py
    CHANGED
    
    | @@ -42,7 +42,8 @@ except Exception as e: | |
| 42 |  | 
| 43 | 
             
                with open('Qwen_Qwen3-4B-Instruct-2507_1.txt', 'a', encoding='utf-8') as f:
         | 
| 44 | 
             
                    import traceback
         | 
| 45 | 
            -
                    f.write(' | 
|  | |
| 46 | 
             
            # Load model directly
         | 
| 47 | 
             
            from transformers import AutoTokenizer, AutoModelForCausalLM
         | 
| 48 |  | 
| @@ -63,7 +64,7 @@ outputs = model.generate(**inputs, max_new_tokens=40) | |
| 63 | 
             
            print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
         | 
| 64 | 
             
            ```
         | 
| 65 | 
             
            ERROR: 
         | 
| 66 | 
            -
            ')
         | 
| 67 | 
             
                    traceback.print_exc(file=f)
         | 
| 68 |  | 
| 69 | 
             
            finally:
         | 
|  | |
| 42 |  | 
| 43 | 
             
                with open('Qwen_Qwen3-4B-Instruct-2507_1.txt', 'a', encoding='utf-8') as f:
         | 
| 44 | 
             
                    import traceback
         | 
| 45 | 
            +
                    f.write('''
         | 
| 46 | 
            +
            ```CODE: 
         | 
| 47 | 
             
            # Load model directly
         | 
| 48 | 
             
            from transformers import AutoTokenizer, AutoModelForCausalLM
         | 
| 49 |  | 
|  | |
| 64 | 
             
            print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
         | 
| 65 | 
             
            ```
         | 
| 66 | 
             
            ERROR: 
         | 
| 67 | 
            +
            ''')
         | 
| 68 | 
             
                    traceback.print_exc(file=f)
         | 
| 69 |  | 
| 70 | 
             
            finally:
         | 
