Spaces:
Sleeping
Sleeping
feat: update
Browse files
app.py
CHANGED
|
@@ -73,9 +73,13 @@ def respond(
|
|
| 73 |
token = json_response['choices'][0].get('delta', {}).get('content', '')
|
| 74 |
if token:
|
| 75 |
response += token
|
| 76 |
-
|
|
|
|
| 77 |
except json.JSONDecodeError:
|
| 78 |
continue
|
|
|
|
|
|
|
|
|
|
| 79 |
|
| 80 |
|
| 81 |
"""
|
|
@@ -86,11 +90,11 @@ demo = gr.ChatInterface(
|
|
| 86 |
additional_inputs=[
|
| 87 |
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
| 88 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
| 89 |
-
gr.Slider(minimum=0.1, maximum=4.0, value=0.
|
| 90 |
gr.Slider(
|
| 91 |
minimum=0.1,
|
| 92 |
maximum=1.0,
|
| 93 |
-
value=0.
|
| 94 |
step=0.05,
|
| 95 |
label="Top-p (nucleus sampling)",
|
| 96 |
),
|
|
|
|
| 73 |
token = json_response['choices'][0].get('delta', {}).get('content', '')
|
| 74 |
if token:
|
| 75 |
response += token
|
| 76 |
+
if response:
|
| 77 |
+
yield response
|
| 78 |
except json.JSONDecodeError:
|
| 79 |
continue
|
| 80 |
+
|
| 81 |
+
if response:
|
| 82 |
+
yield response
|
| 83 |
|
| 84 |
|
| 85 |
"""
|
|
|
|
| 90 |
additional_inputs=[
|
| 91 |
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
| 92 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
| 93 |
+
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
| 94 |
gr.Slider(
|
| 95 |
minimum=0.1,
|
| 96 |
maximum=1.0,
|
| 97 |
+
value=0.96,
|
| 98 |
step=0.05,
|
| 99 |
label="Top-p (nucleus sampling)",
|
| 100 |
),
|