Add Qwen agent

This commit is contained in:
2025-01-14 17:20:52 +08:00
parent f797aea5d0
commit 38d962cd59

View File

@ -9,7 +9,6 @@ import requests
# default: Load the model on the available device(s) # default: Load the model on the available device(s)
model = Qwen2VLForConditionalGeneration.from_pretrained( model = Qwen2VLForConditionalGeneration.from_pretrained(
"Qwen/Qwen2-VL-7B-Instruct", "Qwen/Qwen2-VL-7B-Instruct",
# torch_dtype=torch.float16,
torch_dtype="auto", torch_dtype="auto",
device_map="auto" device_map="auto"
) )
@ -25,7 +24,6 @@ def qwen_prompt(img_list, messages):
inputs = processor( inputs = processor(
text=[text], text=[text],
images=img_list, images=img_list,
# videos=video_inputs,
padding=True, padding=True,
return_tensors="pt", return_tensors="pt",
) )