saksornr commited on
Commit
b17ed29
·
verified ·
1 Parent(s): 2eaf865

Upgrade system prompt

Browse files

Upgrade system prompt to
```
You are an empathetic Thai woman assistant named แม่หมอแพตตี้. (Thai woman will say 'ค่ะ').
You provide insights and support offering clarity and healing.
You always answer in Thai.
First, you need to know these insight ask each one separately.
- What is the problem that user faced.
- How long that user faced.
If the statement is not clear and concise, you can ask multiple times.
And then, you will open one Tarot cards and explain the future of how to fix the problem.
```

Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -10,6 +10,16 @@ client = OpenAI(
10
  api_key=api_key,
11
  )
12
 
 
 
 
 
 
 
 
 
 
 
13
  def predict(message, history, system_prompt, model_id, temperature):
14
  history_openai_format = [{"role": "system", "content": system_prompt}]
15
  for human, assistant in history[-3:]:
@@ -85,7 +95,7 @@ with gr.Blocks(css=CSS) as demo:
85
 
86
  gr.Markdown("### Model Setting")
87
  system_prompt = gr.Code(
88
- value="You are HoraCare, an empathetic Thai girl assistant skilled in psychotherapy and Tarot reading. \nYou provide insights and support using Tarot cards, offering clarity and healing. You always answer in Thai.",
89
  show_label=True,
90
  label="System Prompt",
91
  lines=2
@@ -107,5 +117,4 @@ with gr.Blocks(css=CSS) as demo:
107
  send.click(chat_bot, [msg, chatbot, system_prompt, model_id, temperature], [msg, chatbot])
108
  setting_tab.select(get_log, [chatbot, system_prompt,], [msg_log])
109
 
110
-
111
  demo.launch()
 
10
  api_key=api_key,
11
  )
12
 
13
+ default_system_prompt = """\
14
+ You are an empathetic Thai woman assistant named แม่หมอแพตตี้. (Thai woman will say 'ค่ะ').
15
+ You provide insights and support offering clarity and healing.
16
+ You always answer in Thai.
17
+ First, you need to know these insight ask each one separately.
18
+ - What is the problem that user faced.
19
+ - How long that user faced.
20
+ If the statement is not clear and concise, you can ask multiple times.
21
+ And then, you will open one Tarot cards and explain the future of how to fix the problem."""
22
+
23
  def predict(message, history, system_prompt, model_id, temperature):
24
  history_openai_format = [{"role": "system", "content": system_prompt}]
25
  for human, assistant in history[-3:]:
 
95
 
96
  gr.Markdown("### Model Setting")
97
  system_prompt = gr.Code(
98
+ value=default_system_prompt,
99
  show_label=True,
100
  label="System Prompt",
101
  lines=2
 
117
  send.click(chat_bot, [msg, chatbot, system_prompt, model_id, temperature], [msg, chatbot])
118
  setting_tab.select(get_log, [chatbot, system_prompt,], [msg_log])
119
 
 
120
  demo.launch()