ManishThota commited on
Commit
5b16922
·
verified ·
1 Parent(s): feb7d12

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -18,7 +18,7 @@ def predict_answer(image, question, max_tokens):
18
  text = f"A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: <image>\n{question}? ASSISTANT:"
19
  image = image.convert("RGB")
20
 
21
- input_ids = tokenizer(text, return_tensors='pt').input_ids
22
  image_tensor = model.image_preprocess(image)
23
 
24
  #Generate the answer
 
18
  text = f"A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: <image>\n{question}? ASSISTANT:"
19
  image = image.convert("RGB")
20
 
21
+ input_ids = tokenizer(text, return_tensors='pt').input_ids.to('cuda')
22
  image_tensor = model.image_preprocess(image)
23
 
24
  #Generate the answer