acumplid commited on
Commit
db51483
1 Parent(s): 4c8718d

Update api endpoints

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -179,17 +179,17 @@ def gradio_app():
179
 
180
 
181
 
182
- input_.change(fn=change_interactive, inputs=[input_], outputs=[clear_btn, submit_btn])
183
 
184
- input_.change(fn=None, inputs=[input_], js=f"""(i) => document.getElementById('countertext').textContent = i.length > {MAX_INPUT_CHARACTERS} && 'Max length {MAX_INPUT_CHARACTERS} characters. ' || '' """)
185
 
186
- input_.change(fn=None, inputs=[input_, placeholder_max_token], js="""(i, m) => {
187
  document.getElementById('inputlenght').textContent = i.length + ' '
188
  document.getElementById('inputlenght').style.color = (i.length > m) ? "#ef4444" : "";
189
  }""")
190
 
191
- clear_btn.click(fn=clear, inputs=[], outputs=[input_, output, max_new_tokens, repetition_penalty, top_k, top_p, do_sample, num_beams, temperature], queue=False)
192
- submit_btn.click(fn=submit_input, inputs=[input_, max_new_tokens, repetition_penalty, top_k, top_p, do_sample, num_beams, temperature], outputs=[output])
193
 
194
  demo.launch(show_api=True)
195
 
 
179
 
180
 
181
 
182
+ input_.change(fn=change_interactive, inputs=[input_], outputs=[clear_btn, submit_btn], api_name=False)
183
 
184
+ input_.change(fn=None, inputs=[input_], api_name=False, js=f"""(i) => document.getElementById('countertext').textContent = i.length > {MAX_INPUT_CHARACTERS} && 'Max length {MAX_INPUT_CHARACTERS} characters. ' || '' """)
185
 
186
+ input_.change(fn=None, inputs=[input_, placeholder_max_token], api_name=False, js="""(i, m) => {
187
  document.getElementById('inputlenght').textContent = i.length + ' '
188
  document.getElementById('inputlenght').style.color = (i.length > m) ? "#ef4444" : "";
189
  }""")
190
 
191
+ clear_btn.click(fn=clear, inputs=[], outputs=[input_, output, max_new_tokens, repetition_penalty, top_k, top_p, do_sample, num_beams, temperature], queue=False, api_name=False)
192
+ submit_btn.click(fn=submit_input, inputs=[input_, max_new_tokens, repetition_penalty, top_k, top_p, do_sample, num_beams, temperature], outputs=[output], api_name="get-results")
193
 
194
  demo.launch(show_api=True)
195