RefalMachine commited on
Commit
0cd27a0
·
verified ·
1 Parent(s): 1025cf8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -16,7 +16,9 @@ def respond(
16
  top_p
17
  #repetition_penalty
18
  ):
19
- messages = [{"role": "system", "content": system_message}]
 
 
20
 
21
  for val in history:
22
  if val[0]:
@@ -48,7 +50,7 @@ For information on how to customize the ChatInterface, peruse the gradio docs: h
48
  demo = gr.ChatInterface(
49
  respond,
50
  additional_inputs=[
51
- gr.Textbox(value="Ты продвинутый и полезный ИИ, который грамотно и корректно отвечает на вопросы пользователей.", label="System message"),
52
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
53
  gr.Slider(minimum=0.1, maximum=4.0, value=0.3, step=0.1, label="Temperature"),
54
  gr.Slider(
 
16
  top_p
17
  #repetition_penalty
18
  ):
19
+ messages = []
20
+ if len(system_message.strip()) > 0:
21
+ messages = [{"role": "system", "content": system_message}]
22
 
23
  for val in history:
24
  if val[0]:
 
50
  demo = gr.ChatInterface(
51
  respond,
52
  additional_inputs=[
53
+ gr.Textbox(value="", label="System message"),
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.3, step=0.1, label="Temperature"),
56
  gr.Slider(