ariG23498 HF Staff commited on
Commit
a7c4acb
·
verified ·
1 Parent(s): 73c34b4

Upload Qwen_Qwen3-Omni-30B-A3B-Instruct_0.py with huggingface_hub

Browse files
Qwen_Qwen3-Omni-30B-A3B-Instruct_0.py ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # /// script
2
+ # requires-python = ">=3.12"
3
+ # dependencies = [
4
+ # "numpy",
5
+ # "einops",
6
+ # "pandas",
7
+ # "matplotlib",
8
+ # "paddleorc",
9
+ # "protobuf",
10
+ # "torch",
11
+ # "sentencepiece",
12
+ # "torchvision",
13
+ # "transformers",
14
+ # "timm",
15
+ # "diffusers",
16
+ # "sentence-transformers",
17
+ # "accelerate",
18
+ # "peft",
19
+ # "slack-sdk",
20
+ # ]
21
+ # ///
22
+
23
+ try:
24
+ # Load model directly
25
+ from transformers import AutoProcessor, AutoModelForTextToWaveform
26
+
27
+ processor = AutoProcessor.from_pretrained("Qwen/Qwen3-Omni-30B-A3B-Instruct")
28
+ model = AutoModelForTextToWaveform.from_pretrained("Qwen/Qwen3-Omni-30B-A3B-Instruct")
29
+ with open('Qwen_Qwen3-Omni-30B-A3B-Instruct_0.txt', 'w', encoding='utf-8') as f:
30
+ f.write('Everything was good in Qwen_Qwen3-Omni-30B-A3B-Instruct_0.txt')
31
+ except Exception as e:
32
+ import os
33
+ from slack_sdk import WebClient
34
+ client = WebClient(token=os.environ['SLACK_TOKEN'])
35
+ client.chat_postMessage(
36
+ channel='#hub-model-metadata-snippets-sprint',
37
+ text='Problem in <https://huggingface.co/datasets/model-metadata/code_execution_files/blob/main/Qwen_Qwen3-Omni-30B-A3B-Instruct_0.txt|Qwen_Qwen3-Omni-30B-A3B-Instruct_0.txt>',
38
+ )
39
+
40
+ with open('Qwen_Qwen3-Omni-30B-A3B-Instruct_0.txt', 'a', encoding='utf-8') as f:
41
+ import traceback
42
+ f.write('''```CODE:
43
+ # Load model directly
44
+ from transformers import AutoProcessor, AutoModelForTextToWaveform
45
+
46
+ processor = AutoProcessor.from_pretrained("Qwen/Qwen3-Omni-30B-A3B-Instruct")
47
+ model = AutoModelForTextToWaveform.from_pretrained("Qwen/Qwen3-Omni-30B-A3B-Instruct")
48
+ ```
49
+
50
+ ERROR:
51
+ ''')
52
+ traceback.print_exc(file=f)
53
+
54
+ finally:
55
+ from huggingface_hub import upload_file
56
+ upload_file(
57
+ path_or_fileobj='Qwen_Qwen3-Omni-30B-A3B-Instruct_0.txt',
58
+ repo_id='model-metadata/code_execution_files',
59
+ path_in_repo='Qwen_Qwen3-Omni-30B-A3B-Instruct_0.txt',
60
+ repo_type='dataset',
61
+ )