ariG23498 HF Staff commited on
Commit
6597804
·
verified ·
1 Parent(s): 3d4d9c9

Upload Qwen_Qwen3-VL-32B-Instruct_0.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. Qwen_Qwen3-VL-32B-Instruct_0.py +28 -2
Qwen_Qwen3-VL-32B-Instruct_0.py CHANGED
@@ -11,7 +11,20 @@
11
  # ///
12
 
13
  try:
14
- !pip install -U transformers
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  with open('Qwen_Qwen3-VL-32B-Instruct_0.txt', 'w', encoding='utf-8') as f:
16
  f.write('Everything was good in Qwen_Qwen3-VL-32B-Instruct_0.txt')
17
  except Exception as e:
@@ -26,7 +39,20 @@ except Exception as e:
26
  with open('Qwen_Qwen3-VL-32B-Instruct_0.txt', 'a', encoding='utf-8') as f:
27
  import traceback
28
  f.write('''```CODE:
29
- !pip install -U transformers
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  ```
31
 
32
  ERROR:
 
11
  # ///
12
 
13
  try:
14
+ # Use a pipeline as a high-level helper
15
+ from transformers import pipeline
16
+
17
+ pipe = pipeline("image-text-to-text", model="Qwen/Qwen3-VL-32B-Instruct")
18
+ messages = [
19
+ {
20
+ "role": "user",
21
+ "content": [
22
+ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
23
+ {"type": "text", "text": "What animal is on the candy?"}
24
+ ]
25
+ },
26
+ ]
27
+ pipe(text=messages)
28
  with open('Qwen_Qwen3-VL-32B-Instruct_0.txt', 'w', encoding='utf-8') as f:
29
  f.write('Everything was good in Qwen_Qwen3-VL-32B-Instruct_0.txt')
30
  except Exception as e:
 
39
  with open('Qwen_Qwen3-VL-32B-Instruct_0.txt', 'a', encoding='utf-8') as f:
40
  import traceback
41
  f.write('''```CODE:
42
+ # Use a pipeline as a high-level helper
43
+ from transformers import pipeline
44
+
45
+ pipe = pipeline("image-text-to-text", model="Qwen/Qwen3-VL-32B-Instruct")
46
+ messages = [
47
+ {
48
+ "role": "user",
49
+ "content": [
50
+ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
51
+ {"type": "text", "text": "What animal is on the candy?"}
52
+ ]
53
+ },
54
+ ]
55
+ pipe(text=messages)
56
  ```
57
 
58
  ERROR: