Aratako commited on
Commit
ddc2a8a
·
verified ·
1 Parent(s): 1657768

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -9
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
- #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,11 +132,10 @@ with gr.Blocks(fill_height=True, css=css) as demo:
132
  render=False ),
133
  ],
134
  examples=[
135
- ['How to setup a human base on Mars? Give short answer.'],
136
- ['Explain theory of relativity to me like I’m 8 years old.'],
137
- ['What is 9,000 * 9,000?'],
138
- ['Write a pun-filled happy birthday message to my friend Alex.'],
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
  )