Upload infer_1.py with huggingface_hub
Browse files- infer_1.py +3 -2
infer_1.py
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
|
|
|
|
|
| 1 |
from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
|
| 2 |
from qwen_vl_utils import process_vision_info
|
| 3 |
import json
|
|
@@ -14,8 +16,7 @@ def write_json(file_path, data):
|
|
| 14 |
json.dump(data, file, ensure_ascii=False, indent=4)
|
| 15 |
|
| 16 |
# default: Load the model on the available device(s)
|
| 17 |
-
|
| 18 |
-
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
|
| 19 |
model_path = "/home/zbz5349/WorkSpace/aigeeks/Qwen2.5-VL/ckpt"
|
| 20 |
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 21 |
model_path, torch_dtype="auto", device_map="auto"
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
|
| 3 |
from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
|
| 4 |
from qwen_vl_utils import process_vision_info
|
| 5 |
import json
|
|
|
|
| 16 |
json.dump(data, file, ensure_ascii=False, indent=4)
|
| 17 |
|
| 18 |
# default: Load the model on the available device(s)
|
| 19 |
+
|
|
|
|
| 20 |
model_path = "/home/zbz5349/WorkSpace/aigeeks/Qwen2.5-VL/ckpt"
|
| 21 |
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
| 22 |
model_path, torch_dtype="auto", device_map="auto"
|