Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
|
|
@@ -15,7 +16,7 @@ def respond(
|
|
| 15 |
temperature,
|
| 16 |
top_p,
|
| 17 |
):
|
| 18 |
-
system_message = "You are a good listener. You advise
|
| 19 |
messages = [{"role": "system", "content": system_message}]
|
| 20 |
|
| 21 |
for val in history:
|
|
@@ -46,7 +47,7 @@ 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(value="You are a good listener. You advise
|
| 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(
|
|
@@ -57,15 +58,13 @@ demo = gr.ChatInterface(
|
|
| 57 |
label="Top-p (nucleus sampling)",
|
| 58 |
),
|
| 59 |
],
|
| 60 |
-
examples = [
|
| 61 |
-
["I am feeling overwhelming"],
|
| 62 |
-
["I am tired"],
|
| 63 |
-
["It was a long day"]
|
| 64 |
-
],
|
| 65 |
|
| 66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
)
|
| 68 |
-
|
| 69 |
-
|
| 70 |
if __name__ == "__main__":
|
| 71 |
demo.launch()
|
|
|
|
| 1 |
+
|
| 2 |
import gradio as gr
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
|
|
|
|
| 16 |
temperature,
|
| 17 |
top_p,
|
| 18 |
):
|
| 19 |
+
system_message = "You are a good listener. You advise relaxation exercises, suggest avoiding negative thoughts, and guide through steps to manage stress. Discuss what's on your mind, or ask me for a quick relaxation exercise."
|
| 20 |
messages = [{"role": "system", "content": system_message}]
|
| 21 |
|
| 22 |
for val in history:
|
|
|
|
| 47 |
demo = gr.ChatInterface(
|
| 48 |
respond,
|
| 49 |
additional_inputs=[
|
| 50 |
+
gr.Textbox(value = "You are a good listener. You advise relaxation exercises, suggest avoiding negative thoughts, and guide through steps to manage stress. Discuss what's on your mind, or ask me for a quick relaxation exercise.", label="System message"),
|
| 51 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
| 52 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
| 53 |
gr.Slider(
|
|
|
|
| 58 |
label="Top-p (nucleus sampling)",
|
| 59 |
),
|
| 60 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
+
examples = [
|
| 63 |
+
["I feel overwhelmed with work."],
|
| 64 |
+
["Can you guide me through a quick meditation?"],
|
| 65 |
+
["How do I stop worrying about things I can't control?"]
|
| 66 |
+
],
|
| 67 |
+
title = 'Calm Mate 🕊️'
|
| 68 |
)
|
|
|
|
|
|
|
| 69 |
if __name__ == "__main__":
|
| 70 |
demo.launch()
|