Spaces:
Paused
Paused
Update app.py
Browse files
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
|