acumplid commited on
Commit
34d86b6
·
1 Parent(s): edb7ed1

Opened api client endpoints

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -59,7 +59,7 @@ with gr.Blocks(theme=theme) as app:
59
 
60
  gr.Markdown(description)
61
 
62
- with gr.Row(equal_height=False):
63
 
64
  with gr.Column(variant='panel'):
65
  input_ = gr.Textbox(
@@ -69,7 +69,7 @@ with gr.Blocks(theme=theme) as app:
69
  )
70
 
71
  dialect = gr.Dropdown(label="Dialect", choices=["Central", "Valencian", "North-West"], value="Central")
72
- with gr.Row():
73
  clear_btn = gr.Button(
74
  "Clean",
75
  )
@@ -95,10 +95,9 @@ with gr.Blocks(theme=theme) as app:
95
  fn=submit_input)
96
 
97
  for button in [submit_btn, clear_btn]:
98
- input_.change(fn=change_interactive, inputs=[input_], outputs=button)
99
 
100
- clear_btn.click(fn=clean, inputs=[], outputs=[input_, output] , queue=False)
101
- submit_btn.click(fn=submit_input, inputs=[input_, dialect], outputs=output)
102
 
103
- app.queue(concurrency_count=2, api_open=False)
104
- app.launch(show_api=False, server_name="0.0.0.0", server_port=7860)
 
59
 
60
  gr.Markdown(description)
61
 
62
+ with gr.Row(equal_height=False, variant="panel"):
63
 
64
  with gr.Column(variant='panel'):
65
  input_ = gr.Textbox(
 
69
  )
70
 
71
  dialect = gr.Dropdown(label="Dialect", choices=["Central", "Valencian", "North-West"], value="Central")
72
+ with gr.Row(variant="panel"):
73
  clear_btn = gr.Button(
74
  "Clean",
75
  )
 
95
  fn=submit_input)
96
 
97
  for button in [submit_btn, clear_btn]:
98
+ input_.change(fn=change_interactive, inputs=[input_], outputs=button, api_name=False)
99
 
100
+ clear_btn.click(fn=clean, inputs=[], outputs=[input_, output] , queue=False, api_name=False)
101
+ submit_btn.click(fn=submit_input, inputs=[input_, dialect], outputs=output, api_name="get-results", concurrency_limit=2)
102
 
103
+ app.launch(show_api=True, server_name="0.0.0.0", server_port=7860)