ariG23498 HF Staff commited on
Commit
500c175
·
verified ·
1 Parent(s): f437466

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

Browse files
Files changed (1) hide show
  1. Qwen_Qwen3-VL-2B-Instruct_0.py +28 -9
Qwen_Qwen3-VL-2B-Instruct_0.py CHANGED
@@ -28,17 +28,36 @@ try:
28
  with open('Qwen_Qwen3-VL-2B-Instruct_0.txt', 'w', encoding='utf-8') as f:
29
  f.write('Everything was good in Qwen_Qwen3-VL-2B-Instruct_0.txt')
30
  except Exception as e:
31
- with open('Qwen_Qwen3-VL-2B-Instruct_0.txt', 'w', encoding='utf-8') as f:
 
 
 
 
 
 
 
 
32
  import traceback
33
- traceback.print_exc(file=f)
 
 
34
 
35
- import os
36
- from slack_sdk import WebClient
37
- client = WebClient(token=os.environ['SLACK_TOKEN'])
38
- client.chat_postMessage(
39
- channel='#exp-slack-alerts',
40
- text='Problem in <https://huggingface.co/datasets/model-metadata/code_execution_files/blob/main/Qwen_Qwen3-VL-2B-Instruct_0.txt|Qwen_Qwen3-VL-2B-Instruct_0.txt>',
41
- )
 
 
 
 
 
 
 
 
 
42
  finally:
43
  from huggingface_hub import upload_file
44
  upload_file(
 
28
  with open('Qwen_Qwen3-VL-2B-Instruct_0.txt', 'w', encoding='utf-8') as f:
29
  f.write('Everything was good in Qwen_Qwen3-VL-2B-Instruct_0.txt')
30
  except Exception as e:
31
+ import os
32
+ from slack_sdk import WebClient
33
+ client = WebClient(token=os.environ['SLACK_TOKEN'])
34
+ client.chat_postMessage(
35
+ channel='#exp-slack-alerts',
36
+ text='Problem in <https://huggingface.co/datasets/model-metadata/code_execution_files/blob/main/Qwen_Qwen3-VL-2B-Instruct_0.txt|Qwen_Qwen3-VL-2B-Instruct_0.txt>',
37
+ )
38
+
39
+ with open('Qwen_Qwen3-VL-2B-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-2B-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
+ ERROR:
58
+ ')
59
+ traceback.print_exc(file=f)
60
+
61
  finally:
62
  from huggingface_hub import upload_file
63
  upload_file(