Spaces:
Runtime error
Runtime error
acumplid
commited on
Commit
·
230ff40
1
Parent(s):
7278ac6
Aligned gradio readme version with readme version
Browse files
app.py
CHANGED
|
@@ -106,7 +106,7 @@ with gr.Blocks(**AinaGradioTheme().get_kwargs()) as demo:
|
|
| 106 |
api_name=False
|
| 107 |
)
|
| 108 |
|
| 109 |
-
input_.change(fn=None, inputs=[input_, placeholder_max_characters],
|
| 110 |
document.getElementById('countertext').textContent = i.length > m && 'Max length ' + m + ' characters. ' || ''
|
| 111 |
document.getElementById('inputlenght').textContent = i.length + ' '
|
| 112 |
document.getElementById('inputlenght').style.color = (i.length > m) ? "#ef4444" : "";
|
|
@@ -124,9 +124,10 @@ with gr.Blocks(**AinaGradioTheme().get_kwargs()) as demo:
|
|
| 124 |
fn=submit_input,
|
| 125 |
inputs=[input_],
|
| 126 |
outputs=[output],
|
|
|
|
| 127 |
api_name="get-results"
|
| 128 |
)
|
| 129 |
|
| 130 |
if __name__ == "__main__":
|
| 131 |
-
demo.queue(
|
| 132 |
demo.launch(show_api=True)
|
|
|
|
| 106 |
api_name=False
|
| 107 |
)
|
| 108 |
|
| 109 |
+
input_.change(fn=None, inputs=[input_, placeholder_max_characters], js="""(i, m) => {
|
| 110 |
document.getElementById('countertext').textContent = i.length > m && 'Max length ' + m + ' characters. ' || ''
|
| 111 |
document.getElementById('inputlenght').textContent = i.length + ' '
|
| 112 |
document.getElementById('inputlenght').style.color = (i.length > m) ? "#ef4444" : "";
|
|
|
|
| 124 |
fn=submit_input,
|
| 125 |
inputs=[input_],
|
| 126 |
outputs=[output],
|
| 127 |
+
concurrency_limit=1,
|
| 128 |
api_name="get-results"
|
| 129 |
)
|
| 130 |
|
| 131 |
if __name__ == "__main__":
|
| 132 |
+
demo.queue(api_open=False)
|
| 133 |
demo.launch(show_api=True)
|