Rename dbt1.py to app.py
Browse files- dbt1.py → app.py +5 -11
dbt1.py → app.py
RENAMED
@@ -36,7 +36,7 @@ def respond(
|
|
36 |
temperature: float,
|
37 |
top_p: float,
|
38 |
):
|
39 |
-
system_message = "You are a concise knowledgeable DBT coach.
|
40 |
messages = [{"role": "system", "content": system_message}]
|
41 |
|
42 |
for val in history:
|
@@ -55,10 +55,10 @@ def respond(
|
|
55 |
response = ""
|
56 |
for message in client.chat_completion(
|
57 |
messages,
|
58 |
-
max_tokens=
|
59 |
stream=True,
|
60 |
-
temperature=
|
61 |
-
top_p=
|
62 |
):
|
63 |
token = message.choices[0].delta.content
|
64 |
response += token
|
@@ -75,12 +75,6 @@ with demo:
|
|
75 |
|
76 |
chatbot = gr.ChatInterface(
|
77 |
respond,
|
78 |
-
additional_inputs=[
|
79 |
-
gr.Textbox(value="You are a knowledgeable DBT coach. Use relevant documents to guide users through DBT exercises and provide helpful information.", label="System message"),
|
80 |
-
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
81 |
-
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
82 |
-
gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p (nucleus sampling)"),
|
83 |
-
],
|
84 |
examples=[
|
85 |
["I feel overwhelmed with work. Help me to feel relaxed"],
|
86 |
["Can you guide me through a quick meditation?"],
|
@@ -89,7 +83,7 @@ with demo:
|
|
89 |
["Can you guide to practice a mindfulness excercise?"],
|
90 |
["What is radical acceptance?"]
|
91 |
],
|
92 |
-
title='DBT Coach
|
93 |
)
|
94 |
|
95 |
if __name__ == "__main__":
|
|
|
36 |
temperature: float,
|
37 |
top_p: float,
|
38 |
):
|
39 |
+
system_message = "You are a concise knowledgeable DBT coach. Use relevant documents to guide users through DBT exercises and provide helpful information. You must response in less word and add one follow up question to continue next chat. Like- Would you like to know more about it?"
|
40 |
messages = [{"role": "system", "content": system_message}]
|
41 |
|
42 |
for val in history:
|
|
|
55 |
response = ""
|
56 |
for message in client.chat_completion(
|
57 |
messages,
|
58 |
+
max_tokens= 512,
|
59 |
stream=True,
|
60 |
+
temperature= 0.90,
|
61 |
+
top_p= 0.8,
|
62 |
):
|
63 |
token = message.choices[0].delta.content
|
64 |
response += token
|
|
|
75 |
|
76 |
chatbot = gr.ChatInterface(
|
77 |
respond,
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
examples=[
|
79 |
["I feel overwhelmed with work. Help me to feel relaxed"],
|
80 |
["Can you guide me through a quick meditation?"],
|
|
|
83 |
["Can you guide to practice a mindfulness excercise?"],
|
84 |
["What is radical acceptance?"]
|
85 |
],
|
86 |
+
title='DBT Coach 👩💼'
|
87 |
)
|
88 |
|
89 |
if __name__ == "__main__":
|