Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ question = "What does the label 15 represent? (1) lava (2) core (3) tunnel (4) a
|
|
| 14 |
|
| 15 |
inputs = processor(images=image, text=question, return_tensors="pt")
|
| 16 |
|
| 17 |
-
predictions = model.generate(**inputs)
|
| 18 |
# print(processor.decode(predictions[0], skip_special_tokens=True))
|
| 19 |
|
| 20 |
|
|
@@ -36,7 +36,7 @@ def visual_qna():
|
|
| 36 |
img = load_image()
|
| 37 |
if img:
|
| 38 |
if query := st.chat_input("Enter your message"):
|
| 39 |
-
response = model(question=query, image=img
|
| 40 |
with st.chat_message("assistant"):
|
| 41 |
st.write(response)
|
| 42 |
else:
|
|
|
|
| 14 |
|
| 15 |
inputs = processor(images=image, text=question, return_tensors="pt")
|
| 16 |
|
| 17 |
+
predictions = model.generate(**inputs,max_new_tokens= 50)
|
| 18 |
# print(processor.decode(predictions[0], skip_special_tokens=True))
|
| 19 |
|
| 20 |
|
|
|
|
| 36 |
img = load_image()
|
| 37 |
if img:
|
| 38 |
if query := st.chat_input("Enter your message"):
|
| 39 |
+
response = model(question=query, image=img)
|
| 40 |
with st.chat_message("assistant"):
|
| 41 |
st.write(response)
|
| 42 |
else:
|