Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,6 +16,7 @@ def respond(
|
|
| 16 |
history: list[tuple[str, str]],
|
| 17 |
system_message,
|
| 18 |
max_tokens,
|
|
|
|
| 19 |
temperature,
|
| 20 |
):
|
| 21 |
messages = []
|
|
@@ -31,6 +32,7 @@ def respond(
|
|
| 31 |
"preferences": {
|
| 32 |
"max_char": max_tokens,
|
| 33 |
"temperature": temperature,
|
|
|
|
| 34 |
"system_message": system_message
|
| 35 |
},
|
| 36 |
"conversation_history": messages,
|
|
@@ -55,6 +57,7 @@ demo = gr.ChatInterface(
|
|
| 55 |
additional_inputs=[
|
| 56 |
gr.Textbox(value="You are P-MSQ (Messaging Service Query), a friendly AI Chatbot that can help in any situations. Answer in user's language as concisely as possible.", label="System message"),
|
| 57 |
gr.Slider(minimum=1, maximum=2048, value=1024, step=1, label="Max new tokens"),
|
|
|
|
| 58 |
gr.Slider(minimum=0.1, maximum=1, value=0.7, step=0.1, label="Temperature"),
|
| 59 |
],
|
| 60 |
)
|
|
|
|
| 16 |
history: list[tuple[str, str]],
|
| 17 |
system_message,
|
| 18 |
max_tokens,
|
| 19 |
+
top_p,
|
| 20 |
temperature,
|
| 21 |
):
|
| 22 |
messages = []
|
|
|
|
| 32 |
"preferences": {
|
| 33 |
"max_char": max_tokens,
|
| 34 |
"temperature": temperature,
|
| 35 |
+
"top_p": top_p,
|
| 36 |
"system_message": system_message
|
| 37 |
},
|
| 38 |
"conversation_history": messages,
|
|
|
|
| 57 |
additional_inputs=[
|
| 58 |
gr.Textbox(value="You are P-MSQ (Messaging Service Query), a friendly AI Chatbot that can help in any situations. Answer in user's language as concisely as possible.", label="System message"),
|
| 59 |
gr.Slider(minimum=1, maximum=2048, value=1024, step=1, label="Max new tokens"),
|
| 60 |
+
gr.Slider(minimum=0, maximum=2, value=0.8, step=0.8, label="Top P"),
|
| 61 |
gr.Slider(minimum=0.1, maximum=1, value=0.7, step=0.1, label="Temperature"),
|
| 62 |
],
|
| 63 |
)
|