Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,11 +19,11 @@ def respond(
|
|
| 19 |
|
| 20 |
for val in history:
|
| 21 |
if val[0]:
|
| 22 |
-
messages.append({"role": "
|
| 23 |
if val[1]:
|
| 24 |
messages.append({"role": "assistant", "content": val[1]})
|
| 25 |
|
| 26 |
-
messages.append({"role": "
|
| 27 |
|
| 28 |
response = ""
|
| 29 |
|
|
@@ -43,10 +43,14 @@ def respond(
|
|
| 43 |
"""
|
| 44 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
| 45 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
demo = gr.ChatInterface(
|
| 47 |
respond,
|
| 48 |
additional_inputs=[
|
| 49 |
-
gr.Textbox(value=
|
| 50 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
| 51 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
| 52 |
gr.Slider(
|
|
|
|
| 19 |
|
| 20 |
for val in history:
|
| 21 |
if val[0]:
|
| 22 |
+
messages.append({"role": "world", "content": val[0]})
|
| 23 |
if val[1]:
|
| 24 |
messages.append({"role": "assistant", "content": val[1]})
|
| 25 |
|
| 26 |
+
messages.append({"role": "world", "content": message})
|
| 27 |
|
| 28 |
response = ""
|
| 29 |
|
|
|
|
| 43 |
"""
|
| 44 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
| 45 |
"""
|
| 46 |
+
with open("prompt.txt","r") as prompt_file:
|
| 47 |
+
prompt = prompt_file.read()
|
| 48 |
+
|
| 49 |
+
|
| 50 |
demo = gr.ChatInterface(
|
| 51 |
respond,
|
| 52 |
additional_inputs=[
|
| 53 |
+
gr.Textbox(value=prompt, label="System message"),
|
| 54 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
| 55 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
| 56 |
gr.Slider(
|