Update app.py
Browse files
app.py
CHANGED
|
@@ -15,7 +15,8 @@ def respond(
|
|
| 15 |
temperature,
|
| 16 |
top_p,
|
| 17 |
):
|
| 18 |
-
|
|
|
|
| 19 |
|
| 20 |
for val in history:
|
| 21 |
if val[0]:
|
|
@@ -46,7 +47,10 @@ For information on how to customize the ChatInterface, peruse the gradio docs: h
|
|
| 46 |
demo = gr.ChatInterface(
|
| 47 |
respond,
|
| 48 |
additional_inputs=[
|
| 49 |
-
gr.Textbox(
|
|
|
|
|
|
|
|
|
|
| 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(
|
|
@@ -59,6 +63,5 @@ demo = gr.ChatInterface(
|
|
| 59 |
],
|
| 60 |
)
|
| 61 |
|
| 62 |
-
|
| 63 |
if __name__ == "__main__":
|
| 64 |
demo.launch()
|
|
|
|
| 15 |
temperature,
|
| 16 |
top_p,
|
| 17 |
):
|
| 18 |
+
# Add a friendly tone by default
|
| 19 |
+
messages = [{"role": "system", "content": system_message or "You are a kind and caring AI friend who listens and replies in a helpful, warm, and cheerful way."}]
|
| 20 |
|
| 21 |
for val in history:
|
| 22 |
if val[0]:
|
|
|
|
| 47 |
demo = gr.ChatInterface(
|
| 48 |
respond,
|
| 49 |
additional_inputs=[
|
| 50 |
+
gr.Textbox(
|
| 51 |
+
value="You are a kind and caring AI friend who listens and replies in a helpful, warm, and cheerful way.",
|
| 52 |
+
label="System message"
|
| 53 |
+
),
|
| 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(
|
|
|
|
| 63 |
],
|
| 64 |
)
|
| 65 |
|
|
|
|
| 66 |
if __name__ == "__main__":
|
| 67 |
demo.launch()
|