anzorq commited on
Commit
dc1435f
1 Parent(s): c088357
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -38,7 +38,7 @@ def on_prompt_template_change(prompt_template):
38
  def submit_message(user_token, prompt, prompt_template, temperature, max_tokens, state):
39
 
40
  if not prompt:
41
- return
42
 
43
  history = state['messages']
44
 
@@ -120,8 +120,8 @@ with gr.Blocks(css=css) as demo:
120
  prompt_template = gr.Dropdown(label="Set a custom insruction for the chatbot:", choices=list(prompt_templates.keys()))
121
  prompt_template_preview = gr.Markdown(elem_id="prompt_template_preview")
122
  with gr.Accordion("Advanced parameters", open=False):
123
- temperature = gr.Slider(minimum=0, maximum=2.0, value=0.7, step=0.1, interactive=True, label="Temperature (higher = more creative/chaotic)")
124
- max_tokens = gr.Slider(minimum=100, maximum=4096, value=1000, step=1, interactive=True, label="Max tokens per response")
125
 
126
  gr.HTML('''<br><br><br><center><a href="https://huggingface.co/spaces/anzorq/chatgpt-demo?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>You can duplicate this Space.<br>
127
  Don't forget to set your own <a href="https://platform.openai.com/account/api-keys">OpenAI API Key</a> environment variable in Settings.<br>
 
38
  def submit_message(user_token, prompt, prompt_template, temperature, max_tokens, state):
39
 
40
  if not prompt:
41
+ return gr.update(value=''), None, "", state
42
 
43
  history = state['messages']
44
 
 
120
  prompt_template = gr.Dropdown(label="Set a custom insruction for the chatbot:", choices=list(prompt_templates.keys()))
121
  prompt_template_preview = gr.Markdown(elem_id="prompt_template_preview")
122
  with gr.Accordion("Advanced parameters", open=False):
123
+ temperature = gr.Slider(minimum=0, maximum=2.0, value=0.7, step=0.1, label="Temperature (higher = more creative/chaotic)")
124
+ max_tokens = gr.Slider(minimum=100, maximum=4096, value=1000, step=1, label="Max tokens per response")
125
 
126
  gr.HTML('''<br><br><br><center><a href="https://huggingface.co/spaces/anzorq/chatgpt-demo?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>You can duplicate this Space.<br>
127
  Don't forget to set your own <a href="https://platform.openai.com/account/api-keys">OpenAI API Key</a> environment variable in Settings.<br>