Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -42,7 +42,7 @@ tokenizer = AutoTokenizer.from_pretrained("ManishThota/Sparrow", trust_remote_co
|
|
| 42 |
def predict_answer(image, question, max_tokens):
|
| 43 |
#Set inputs
|
| 44 |
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:"
|
| 45 |
-
image =
|
| 46 |
|
| 47 |
input_ids = tokenizer(text, return_tensors='pt').input_ids
|
| 48 |
image_tensor = model.image_preprocess(image)
|
|
|
|
| 42 |
def predict_answer(image, question, max_tokens):
|
| 43 |
#Set inputs
|
| 44 |
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:"
|
| 45 |
+
image = image.convert("RGB")
|
| 46 |
|
| 47 |
input_ids = tokenizer(text, return_tensors='pt').input_ids
|
| 48 |
image_tensor = model.image_preprocess(image)
|