Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse filesAdd button for `parse_query`
app.py
CHANGED
@@ -153,6 +153,7 @@ with gr.Blocks(title="GLiNER-query-parser") as demo:
|
|
153 |
|
154 |
output = gr.HighlightedText(label="Annotated entities")
|
155 |
submit_btn = gr.Button("Submit")
|
|
|
156 |
|
157 |
# Submitting
|
158 |
query.submit(
|
@@ -173,6 +174,9 @@ with gr.Blocks(title="GLiNER-query-parser") as demo:
|
|
173 |
model_name.change(
|
174 |
fn=annotate_query, inputs=[query, entities, threshold, is_nested, model_name], outputs=output
|
175 |
)
|
|
|
|
|
|
|
176 |
|
177 |
demo.queue(default_concurrency_limit=5)
|
178 |
demo.launch(debug=True)
|
|
|
153 |
|
154 |
output = gr.HighlightedText(label="Annotated entities")
|
155 |
submit_btn = gr.Button("Submit")
|
156 |
+
hidden_button = gr.Button("", visible=False)
|
157 |
|
158 |
# Submitting
|
159 |
query.submit(
|
|
|
174 |
model_name.change(
|
175 |
fn=annotate_query, inputs=[query, entities, threshold, is_nested, model_name], outputs=output
|
176 |
)
|
177 |
+
hidden_button.click(
|
178 |
+
fn=parse_query, inputs=[query, entities, threshold, is_nested, model_name], outputs=output
|
179 |
+
)
|
180 |
|
181 |
demo.queue(default_concurrency_limit=5)
|
182 |
demo.launch(debug=True)
|