Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -45,11 +45,6 @@ def cached_vision_process(image, max_crops, num_tokens):
|
|
45 |
def answer_question(image, question, max_crops, num_tokens):
|
46 |
prompt = f"""<|im_start|>user
|
47 |
<image>
|
48 |
-
{question}<|im_end|>
|
49 |
-
<|im_start|>assistant
|
50 |
-
"""
|
51 |
-
replace_prompt = f"""<|im_start|>user
|
52 |
-
|
53 |
{question}<|im_end|>
|
54 |
<|im_start|>assistant
|
55 |
"""
|
@@ -74,7 +69,7 @@ def answer_question(image, question, max_crops, num_tokens):
|
|
74 |
buffer += new_text
|
75 |
print(buffer)
|
76 |
if len(buffer) > 1:
|
77 |
-
yield buffer[len(
|
78 |
|
79 |
|
80 |
with gr.Blocks() as demo:
|
|
|
45 |
def answer_question(image, question, max_crops, num_tokens):
|
46 |
prompt = f"""<|im_start|>user
|
47 |
<image>
|
|
|
|
|
|
|
|
|
|
|
48 |
{question}<|im_end|>
|
49 |
<|im_start|>assistant
|
50 |
"""
|
|
|
69 |
buffer += new_text
|
70 |
print(buffer)
|
71 |
if len(buffer) > 1:
|
72 |
+
yield buffer[len(prompt) :]
|
73 |
|
74 |
|
75 |
with gr.Blocks() as demo:
|