ariG23498 HF Staff commited on
Commit
8e79cdb
·
verified ·
1 Parent(s): 9d0b16d

Upload Qwen_Qwen3-VL-32B-Instruct-FP8_0.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. Qwen_Qwen3-VL-32B-Instruct-FP8_0.py +40 -0
Qwen_Qwen3-VL-32B-Instruct-FP8_0.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # /// script
2
+ # requires-python = ">=3.12"
3
+ # dependencies = [
4
+ # "torch",
5
+ # "torchvision",
6
+ # "transformers",
7
+ # "accelerate",
8
+ # "peft",
9
+ # ]
10
+ # ///
11
+
12
+ try:
13
+ # Use a pipeline as a high-level helper
14
+ from transformers import pipeline
15
+
16
+ pipe = pipeline("image-text-to-text", model="Qwen/Qwen3-VL-32B-Instruct-FP8")
17
+ messages = [
18
+ {
19
+ "role": "user",
20
+ "content": [
21
+ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
22
+ {"type": "text", "text": "What animal is on the candy?"}
23
+ ]
24
+ },
25
+ ]
26
+ pipe(text=messages)
27
+ with open('Qwen_Qwen3-VL-32B-Instruct-FP8_0.txt', 'w', encoding='utf-8') as f:
28
+ f.write('Everything was good in Qwen_Qwen3-VL-32B-Instruct-FP8_0.txt')
29
+ except Exception as e:
30
+ with open('Qwen_Qwen3-VL-32B-Instruct-FP8_0.txt', 'w', encoding='utf-8') as f:
31
+ import traceback
32
+ traceback.print_exc(file=f)
33
+ finally:
34
+ from huggingface_hub import upload_file
35
+ upload_file(
36
+ path_or_fileobj='Qwen_Qwen3-VL-32B-Instruct-FP8_0.txt',
37
+ repo_id='model-metadata/code_execution_files',
38
+ path_in_repo='Qwen_Qwen3-VL-32B-Instruct-FP8_0.txt',
39
+ repo_type='dataset',
40
+ )