Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -69,8 +69,10 @@ def bot_streaming(message, history, max_new_tokens=250):
|
|
| 69 |
buffer += new_text
|
| 70 |
generated_text_without_prompt = buffer
|
| 71 |
time.sleep(0.01)
|
| 72 |
-
|
| 73 |
-
|
|
|
|
|
|
|
| 74 |
yield buffer
|
| 75 |
|
| 76 |
|
|
@@ -85,7 +87,7 @@ demo = gr.ChatInterface(fn=bot_streaming, title="LLaVA-CoT",
|
|
| 85 |
)
|
| 86 |
],
|
| 87 |
cache_examples=False,
|
| 88 |
-
description="Upload an image, and start chatting about it. To learn more about LLaVA-CoT, visit [oir GitHub page](https://github.com/PKU-YuanGroup/LLaVA-CoT). ",
|
| 89 |
stop_btn="Stop Generation",
|
| 90 |
fill_height=True,
|
| 91 |
multimodal=True)
|
|
|
|
| 69 |
buffer += new_text
|
| 70 |
generated_text_without_prompt = buffer
|
| 71 |
time.sleep(0.01)
|
| 72 |
+
|
| 73 |
+
buffer = re.sub(r"<(\w+)>", r"(Here begins the \1 stage)", buffer)
|
| 74 |
+
buffer = re.sub(r"</(\w+)>", r"(Here ends the \1 stage)", buffer)
|
| 75 |
+
|
| 76 |
yield buffer
|
| 77 |
|
| 78 |
|
|
|
|
| 87 |
)
|
| 88 |
],
|
| 89 |
cache_examples=False,
|
| 90 |
+
description="Upload an image, and start chatting about it. To learn more about LLaVA-CoT, visit [oir GitHub page](https://github.com/PKU-YuanGroup/LLaVA-CoT). Note: Since Gradio currently does not support displaying the <X> symbol in the output, we have replaced it with the expression (Here begins the X phase).",
|
| 91 |
stop_btn="Stop Generation",
|
| 92 |
fill_height=True,
|
| 93 |
multimodal=True)
|