Update app.py
Browse files
app.py
CHANGED
|
@@ -98,10 +98,10 @@ def chat_llama3_8b(message: str,
|
|
| 98 |
outputs = []
|
| 99 |
for text in streamer:
|
| 100 |
# Remove thinking tags to prevent Gradio display issues
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
outputs.append(text)
|
| 106 |
print("".join(outputs))
|
| 107 |
yield "".join(outputs)
|
|
@@ -132,11 +132,10 @@ with gr.Blocks(fill_height=True, css=css) as demo:
|
|
| 132 |
render=False ),
|
| 133 |
],
|
| 134 |
examples=[
|
| 135 |
-
['
|
| 136 |
-
['
|
| 137 |
-
['
|
| 138 |
-
['
|
| 139 |
-
['Justify why a penguin might make a good king of the jungle.']
|
| 140 |
],
|
| 141 |
cache_examples=False,
|
| 142 |
)
|
|
|
|
| 98 |
outputs = []
|
| 99 |
for text in streamer:
|
| 100 |
# Remove thinking tags to prevent Gradio display issues
|
| 101 |
+
if "<think>" in text:
|
| 102 |
+
text = text.replace("<think>", "[think]").strip()
|
| 103 |
+
if "</think>" in text:
|
| 104 |
+
text = text.replace("</think>", "[/think]").strip()
|
| 105 |
outputs.append(text)
|
| 106 |
print("".join(outputs))
|
| 107 |
yield "".join(outputs)
|
|
|
|
| 132 |
render=False ),
|
| 133 |
],
|
| 134 |
examples=[
|
| 135 |
+
['確率論を小学生にもわかるように説明してください。'],
|
| 136 |
+
['9000 * 9000を計算してください。'],
|
| 137 |
+
['Pythonで高速なソートを実装するコードを教えてください。'],
|
| 138 |
+
['ペンギンがジャングルの王になれるという話を正当化してください。']
|
|
|
|
| 139 |
],
|
| 140 |
cache_examples=False,
|
| 141 |
)
|