ariG23498 HF Staff commited on
Commit
321568a
·
verified ·
1 Parent(s): 2835a3b

Upload Qwen_Qwen3-VL-Reranker-2B_0.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. Qwen_Qwen3-VL-Reranker-2B_0.py +8 -6
Qwen_Qwen3-VL-Reranker-2B_0.py CHANGED
@@ -20,10 +20,11 @@
20
  # ///
21
 
22
  try:
23
- # Use a pipeline as a high-level helper
24
- from transformers import pipeline
25
 
26
- pipe = pipeline("image-to-text", model="Qwen/Qwen3-VL-Reranker-2B")
 
27
  with open('Qwen_Qwen3-VL-Reranker-2B_0.txt', 'w', encoding='utf-8') as f:
28
  f.write('Everything was good in Qwen_Qwen3-VL-Reranker-2B_0.txt')
29
  except Exception as e:
@@ -38,10 +39,11 @@ except Exception as e:
38
  with open('Qwen_Qwen3-VL-Reranker-2B_0.txt', 'a', encoding='utf-8') as f:
39
  import traceback
40
  f.write('''```CODE:
41
- # Use a pipeline as a high-level helper
42
- from transformers import pipeline
43
 
44
- pipe = pipeline("image-to-text", model="Qwen/Qwen3-VL-Reranker-2B")
 
45
  ```
46
 
47
  ERROR:
 
20
  # ///
21
 
22
  try:
23
+ # Load model directly
24
+ from transformers import AutoProcessor, AutoModelForImageTextToText
25
 
26
+ processor = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-Reranker-2B")
27
+ model = AutoModelForImageTextToText.from_pretrained("Qwen/Qwen3-VL-Reranker-2B")
28
  with open('Qwen_Qwen3-VL-Reranker-2B_0.txt', 'w', encoding='utf-8') as f:
29
  f.write('Everything was good in Qwen_Qwen3-VL-Reranker-2B_0.txt')
30
  except Exception as e:
 
39
  with open('Qwen_Qwen3-VL-Reranker-2B_0.txt', 'a', encoding='utf-8') as f:
40
  import traceback
41
  f.write('''```CODE:
42
+ # Load model directly
43
+ from transformers import AutoProcessor, AutoModelForImageTextToText
44
 
45
+ processor = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-Reranker-2B")
46
+ model = AutoModelForImageTextToText.from_pretrained("Qwen/Qwen3-VL-Reranker-2B")
47
  ```
48
 
49
  ERROR: