Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,7 @@ model = AutoModelForCausalLM.from_pretrained("ManishThota/SparrowVQE",
|
|
21 |
trust_remote_code=True)
|
22 |
tokenizer = AutoTokenizer.from_pretrained("ManishThota/SparrowVQE", trust_remote_code=True)
|
23 |
|
24 |
-
def predict_answer(image, question, max_tokens):
|
25 |
#Set inputs
|
26 |
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:"
|
27 |
image = image.convert("RGB")
|
@@ -57,7 +57,7 @@ iface = gr.Interface(
|
|
57 |
fn=gradio_predict,
|
58 |
inputs=[gr.Image(type="pil", label="Upload or Drag an Image"),
|
59 |
gr.Textbox(label="Question", placeholder="e.g. Can you explain the slide?", scale=4),
|
60 |
-
gr.Slider(2, 500, value=
|
61 |
outputs=gr.TextArea(label="Answer"),
|
62 |
examples=examples,
|
63 |
title="Sparrow - Tiny 3B | Visual Question Answering",
|
|
|
21 |
trust_remote_code=True)
|
22 |
tokenizer = AutoTokenizer.from_pretrained("ManishThota/SparrowVQE", trust_remote_code=True)
|
23 |
|
24 |
+
def predict_answer(image, question, max_tokens=100):
|
25 |
#Set inputs
|
26 |
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:"
|
27 |
image = image.convert("RGB")
|
|
|
57 |
fn=gradio_predict,
|
58 |
inputs=[gr.Image(type="pil", label="Upload or Drag an Image"),
|
59 |
gr.Textbox(label="Question", placeholder="e.g. Can you explain the slide?", scale=4),
|
60 |
+
gr.Slider(2, 500, value=25, label="Token Count", info="Choose between 2 and 500")],
|
61 |
outputs=gr.TextArea(label="Answer"),
|
62 |
examples=examples,
|
63 |
title="Sparrow - Tiny 3B | Visual Question Answering",
|