Upload Qwen_Qwen3-VL-30B-A3B-Instruct_1.py with huggingface_hub
Browse files
    	
        Qwen_Qwen3-VL-30B-A3B-Instruct_1.py
    ADDED
    
    | @@ -0,0 +1,45 @@ | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
|  | |
| 1 | 
            +
            # /// script
         | 
| 2 | 
            +
            # requires-python = ">=3.12"
         | 
| 3 | 
            +
            # dependencies = [
         | 
| 4 | 
            +
            #     "torch",
         | 
| 5 | 
            +
            #     "torchvision",
         | 
| 6 | 
            +
            #     "transformers",
         | 
| 7 | 
            +
            #     "accelerate",
         | 
| 8 | 
            +
            #     "peft",
         | 
| 9 | 
            +
            #     "slack-sdk",
         | 
| 10 | 
            +
            # ]
         | 
| 11 | 
            +
            # ///
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            try:
         | 
| 14 | 
            +
                import os
         | 
| 15 | 
            +
                os.environ['HF_TOKEN'] = 'YOUR_TOKEN_HERE'
         | 
| 16 | 
            +
                with open('Qwen_Qwen3-VL-30B-A3B-Instruct_1.txt', 'w', encoding='utf-8') as f:
         | 
| 17 | 
            +
                    f.write('Everything was good in Qwen_Qwen3-VL-30B-A3B-Instruct_1.txt')
         | 
| 18 | 
            +
            except Exception as e:
         | 
| 19 | 
            +
                import os
         | 
| 20 | 
            +
                from slack_sdk import WebClient
         | 
| 21 | 
            +
                client = WebClient(token=os.environ['SLACK_TOKEN'])
         | 
| 22 | 
            +
                client.chat_postMessage(
         | 
| 23 | 
            +
                    channel='#exp-slack-alerts',
         | 
| 24 | 
            +
                    text='Problem in <https://huggingface.co/datasets/model-metadata/code_execution_files/blob/main/Qwen_Qwen3-VL-30B-A3B-Instruct_1.txt|Qwen_Qwen3-VL-30B-A3B-Instruct_1.txt>',
         | 
| 25 | 
            +
                )
         | 
| 26 | 
            +
             | 
| 27 | 
            +
                with open('Qwen_Qwen3-VL-30B-A3B-Instruct_1.txt', 'a', encoding='utf-8') as f:
         | 
| 28 | 
            +
                    import traceback
         | 
| 29 | 
            +
                    f.write('''```CODE: 
         | 
| 30 | 
            +
            import os
         | 
| 31 | 
            +
            os.environ['HF_TOKEN'] = 'YOUR_TOKEN_HERE'
         | 
| 32 | 
            +
            ```
         | 
| 33 | 
            +
             | 
| 34 | 
            +
            ERROR: 
         | 
| 35 | 
            +
            ''')
         | 
| 36 | 
            +
                    traceback.print_exc(file=f)
         | 
| 37 | 
            +
                
         | 
| 38 | 
            +
            finally:
         | 
| 39 | 
            +
                from huggingface_hub import upload_file
         | 
| 40 | 
            +
                upload_file(
         | 
| 41 | 
            +
                    path_or_fileobj='Qwen_Qwen3-VL-30B-A3B-Instruct_1.txt',
         | 
| 42 | 
            +
                    repo_id='model-metadata/code_execution_files',
         | 
| 43 | 
            +
                    path_in_repo='Qwen_Qwen3-VL-30B-A3B-Instruct_1.txt',
         | 
| 44 | 
            +
                    repo_type='dataset',
         | 
| 45 | 
            +
                )
         | 
