SkyNetWalker commited on
Commit
4132916
·
verified ·
1 Parent(s): 700ffae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -17,9 +17,11 @@ client = OpenAI(
17
  print("Client initialized.")
18
 
19
  SYSTEM_PROMPTS = {
20
- "General Assistant": "You are a helpful, respectful and honest assistant. Always provide accurate information and admit when you're not sure about something.",
21
- "Code Helper": "You are a programming assistant. Help users with coding questions, debugging, and best practices. Provide clear explanations and code examples when appropriate.",
22
- "Creative Writer": "You are a creative writing assistant. Help users with storytelling, character development, and creative writing techniques. Be imaginative and encouraging."
 
 
23
  }
24
 
25
  def respond(
@@ -90,7 +92,7 @@ with gr.Blocks() as demo:
90
  )
91
 
92
  # Create the chat components separately
93
- chatbot = gr.Chatbot(height=400)
94
  msg = gr.Textbox(
95
  show_label=False,
96
  placeholder="Enter text and press enter",
@@ -112,8 +114,8 @@ with gr.Blocks() as demo:
112
  )
113
  max_tokens = gr.Slider(
114
  minimum=1,
115
- maximum=4096,
116
- value=1024,
117
  step=1,
118
  label="Max new tokens:"
119
  )
 
17
  print("Client initialized.")
18
 
19
  SYSTEM_PROMPTS = {
20
+ "zh-HK": "Chat by Cantonese language of Hong Kong (Yue). No chatty. Answer in simple but accurate way.",
21
+ "zh-TW": "Chat by Traditional Chinese language of Taiwan (zh-TW). No chatty. Answer in simple but accurate way.",
22
+ "EN: General Assistant": "You are a helpful, respectful and honest assistant. Always provide accurate information and admit when you're not sure about something.",
23
+ "EN: Code Helper": "You are a programming assistant. Help users with coding questions, debugging, and best practices. Provide clear explanations and code examples when appropriate.",
24
+ "EN: Creative Writer": "You are a creative writing assistant. Help users with storytelling, character development, and creative writing techniques. Be imaginative and encouraging."
25
  }
26
 
27
  def respond(
 
92
  )
93
 
94
  # Create the chat components separately
95
+ chatbot = gr.Chatbot(height=600)
96
  msg = gr.Textbox(
97
  show_label=False,
98
  placeholder="Enter text and press enter",
 
114
  )
115
  max_tokens = gr.Slider(
116
  minimum=1,
117
+ maximum=8192,
118
+ value=2048,
119
  step=1,
120
  label="Max new tokens:"
121
  )