Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,6 @@ import string
|
|
8 |
import gradio as gr
|
9 |
import requests
|
10 |
|
11 |
-
lang = "en"
|
12 |
|
13 |
def process_results(results, highlight_terms):
|
14 |
if len(results) == 0:
|
@@ -96,7 +95,7 @@ if __name__ == "__main__":
|
|
96 |
with gr.Row():
|
97 |
results = gr.HTML(label="Results")
|
98 |
|
99 |
-
def submit(query,
|
100 |
query = query.strip()
|
101 |
if query is None or query == "":
|
102 |
return "", ""
|
@@ -104,7 +103,7 @@ if __name__ == "__main__":
|
|
104 |
results: scisearch(query, lang, k),
|
105 |
}
|
106 |
|
107 |
-
query.submit(fn=submit, inputs=[query,
|
108 |
-
submit_btn.click(submit, inputs=[query,
|
109 |
|
110 |
demo.launch(enable_queue=True, debug=True)
|
|
|
8 |
import gradio as gr
|
9 |
import requests
|
10 |
|
|
|
11 |
|
12 |
def process_results(results, highlight_terms):
|
13 |
if len(results) == 0:
|
|
|
95 |
with gr.Row():
|
96 |
results = gr.HTML(label="Results")
|
97 |
|
98 |
+
def submit(query, k, lang="en"):
|
99 |
query = query.strip()
|
100 |
if query is None or query == "":
|
101 |
return "", ""
|
|
|
103 |
results: scisearch(query, lang, k),
|
104 |
}
|
105 |
|
106 |
+
query.submit(fn=submit, inputs=[query, k], outputs=[results])
|
107 |
+
submit_btn.click(submit, inputs=[query, k], outputs=[results])
|
108 |
|
109 |
demo.launch(enable_queue=True, debug=True)
|