Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -264,6 +264,8 @@ def run(q, top_k, max_len, thresh, lang_code):
|
|
| 264 |
# =========================
|
| 265 |
# Gradio App
|
| 266 |
# =========================
|
|
|
|
|
|
|
| 267 |
with gr.Blocks(title="Salatus QA — Question-Only", css=CSS, theme=gr.themes.Soft()) as demo:
|
| 268 |
gr.HTML(
|
| 269 |
f"""
|
|
@@ -322,7 +324,8 @@ with gr.Blocks(title="Salatus QA — Question-Only", css=CSS, theme=gr.themes.So
|
|
| 322 |
def run(q, top_k_, max_len_, thresh_, lang_code):
|
| 323 |
return run(q_, top_k_, max_len_, thresh_, lang_code)
|
| 324 |
|
| 325 |
-
btn_ask.click(
|
|
|
|
| 326 |
|
| 327 |
# Update labels when language toggles
|
| 328 |
def switch_labels(code):
|
|
|
|
| 264 |
# =========================
|
| 265 |
# Gradio App
|
| 266 |
# =========================
|
| 267 |
+
def run_click(q, top_k, max_len, thresh, lang_code):
|
| 268 |
+
return run(q, top_k, max_len, thresh, lang_code)
|
| 269 |
with gr.Blocks(title="Salatus QA — Question-Only", css=CSS, theme=gr.themes.Soft()) as demo:
|
| 270 |
gr.HTML(
|
| 271 |
f"""
|
|
|
|
| 324 |
def run(q, top_k_, max_len_, thresh_, lang_code):
|
| 325 |
return run(q_, top_k_, max_len_, thresh_, lang_code)
|
| 326 |
|
| 327 |
+
btn_ask.click(run_click, inputs=[q, top_k, max_len, thresh, lang],
|
| 328 |
+
outputs=[ans, sent, html, tops, rets])
|
| 329 |
|
| 330 |
# Update labels when language toggles
|
| 331 |
def switch_labels(code):
|