cyberandy commited on
Commit
12448b6
·
1 Parent(s): c7dae24

remove cuda

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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
- .cuda()
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("cuda")
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)