Omnibus commited on
Commit
733d330
·
verified ·
1 Parent(s): 12a0a37

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -84,9 +84,9 @@ def generate(prompt, history,max_new_tokens,health,temperature=temperature,top_p
84
  for response in stream:
85
  output += response.token.text
86
  if history:
87
- yield "",[(prompt,output)],stats,None,None
88
  else:
89
- yield "",[(prompt,output)],stats,None,None
90
  generate_kwargs2 = dict(
91
  temperature=temperature,
92
  max_new_tokens=128,
@@ -139,9 +139,9 @@ def generate(prompt, history,max_new_tokens,health,temperature=temperature,top_p
139
 
140
  if history:
141
  history.append((prompt,output))
142
- yield "",history,stats,skills,opts
143
  else:
144
- yield "",[(prompt,output)],stats,skills,opts
145
 
146
  def clear_fn():
147
  return None,None
@@ -164,10 +164,10 @@ with gr.Blocks() as app:
164
  chatbot = gr.Chatbot(label="Mixtral 8x7B Chatbot",height=300, layout='panel', show_copy_button=True)
165
  with gr.Row():
166
  with gr.Column(scale=3):
167
- prompt=gr.Textbox(label = "Prompt", value="Start a new game")
 
168
  with gr.Column(scale=2):
169
  button=gr.Button()
170
- opt=gr.Dropdown(label="Choices")
171
  #models_dd=gr.Dropdown(choices=[m for m in return_list],interactive=True)
172
  with gr.Row():
173
  stop_button=gr.Button("Stop")
@@ -186,8 +186,8 @@ with gr.Blocks() as app:
186
  #text=gr.JSON()
187
  #inp_query.change(search_models,inp_query,models_dd)
188
  #test_b=test_btn.click(itt,url,e_box)
189
- clear_btn.click(clear_fn,None,[prompt,chatbot])
190
- go=button.click(generate,[prompt,chatbot,tokens,char_stats],[prompt,chatbot,char_stats,json_out,opt])
191
  stop_button.click(None,None,None,cancels=[go])
192
  app.launch(show_api=False)
193
 
 
84
  for response in stream:
85
  output += response.token.text
86
  if history:
87
+ yield [(prompt,output)],stats,None,None
88
  else:
89
+ yield [(prompt,output)],stats,None,None
90
  generate_kwargs2 = dict(
91
  temperature=temperature,
92
  max_new_tokens=128,
 
139
 
140
  if history:
141
  history.append((prompt,output))
142
+ yield history,stats,skills,opts
143
  else:
144
+ yield [(prompt,output)],stats,skills,opts
145
 
146
  def clear_fn():
147
  return None,None
 
164
  chatbot = gr.Chatbot(label="Mixtral 8x7B Chatbot",height=300, layout='panel', show_copy_button=True)
165
  with gr.Row():
166
  with gr.Column(scale=3):
167
+ opt=gr.Dropdown(label="Choices", value="Start a new game", interactive=True)
168
+ #prompt=gr.Textbox(label = "Prompt", value="Start a new game")
169
  with gr.Column(scale=2):
170
  button=gr.Button()
 
171
  #models_dd=gr.Dropdown(choices=[m for m in return_list],interactive=True)
172
  with gr.Row():
173
  stop_button=gr.Button("Stop")
 
186
  #text=gr.JSON()
187
  #inp_query.change(search_models,inp_query,models_dd)
188
  #test_b=test_btn.click(itt,url,e_box)
189
+ clear_btn.click(clear_fn,None,[opt,chatbot])
190
+ go=button.click(generate,[opt,chatbot,tokens,char_stats],[chatbot,char_stats,json_out,opt])
191
  stop_button.click(None,None,None,cancels=[go])
192
  app.launch(show_api=False)
193