Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,7 @@ import gradio as gr
|
|
7 |
from gradio import FileData
|
8 |
import time
|
9 |
import spaces
|
|
|
10 |
ckpt = "Xkev/Llama-3.2V-11B-cot"
|
11 |
model = MllamaForConditionalGeneration.from_pretrained(ckpt,
|
12 |
torch_dtype=torch.bfloat16).to("cuda")
|
@@ -68,7 +69,8 @@ def bot_streaming(message, history, max_new_tokens=250):
|
|
68 |
buffer += new_text
|
69 |
generated_text_without_prompt = buffer
|
70 |
time.sleep(0.01)
|
71 |
-
buffer.
|
|
|
72 |
yield buffer
|
73 |
|
74 |
|
|
|
7 |
from gradio import FileData
|
8 |
import time
|
9 |
import spaces
|
10 |
+
import re
|
11 |
ckpt = "Xkev/Llama-3.2V-11B-cot"
|
12 |
model = MllamaForConditionalGeneration.from_pretrained(ckpt,
|
13 |
torch_dtype=torch.bfloat16).to("cuda")
|
|
|
69 |
buffer += new_text
|
70 |
generated_text_without_prompt = buffer
|
71 |
time.sleep(0.01)
|
72 |
+
buffer = re.sub(r"<.*?>", "", buffer)
|
73 |
+
print(f"Buffer: {buffer}")
|
74 |
yield buffer
|
75 |
|
76 |
|