remove cuda
Browse files
app.py
CHANGED
@@ -40,7 +40,7 @@ models = {
|
|
40 |
"Qwen/Qwen2-VL-7B-Instruct": Qwen2VLForConditionalGeneration.from_pretrained(
|
41 |
"Qwen/Qwen2-VL-7B-Instruct", trust_remote_code=True, torch_dtype="auto"
|
42 |
)
|
43 |
-
.
|
44 |
.eval()
|
45 |
}
|
46 |
|
@@ -95,7 +95,7 @@ def run_example(image, text_input=None, model_id="Qwen/Qwen2-VL-7B-Instruct"):
|
|
95 |
padding=True,
|
96 |
return_tensors="pt",
|
97 |
)
|
98 |
-
inputs = inputs.to("
|
99 |
|
100 |
# Inference: Generation of the output
|
101 |
generated_ids = model.generate(**inputs, max_new_tokens=1024)
|
|
|
40 |
"Qwen/Qwen2-VL-7B-Instruct": Qwen2VLForConditionalGeneration.from_pretrained(
|
41 |
"Qwen/Qwen2-VL-7B-Instruct", trust_remote_code=True, torch_dtype="auto"
|
42 |
)
|
43 |
+
.cpu()
|
44 |
.eval()
|
45 |
}
|
46 |
|
|
|
95 |
padding=True,
|
96 |
return_tensors="pt",
|
97 |
)
|
98 |
+
inputs = inputs.to("cpu")
|
99 |
|
100 |
# Inference: Generation of the output
|
101 |
generated_ids = model.generate(**inputs, max_new_tokens=1024)
|