Spaces:
Sleeping
Sleeping
Added Queries
Browse files
app.py
CHANGED
@@ -1,25 +1,26 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
def urlProcess(
|
4 |
-
return
|
5 |
|
6 |
-
def uploadProcess(upload):
|
7 |
-
return
|
8 |
|
9 |
with gr.Blocks() as demo:
|
10 |
gr.Markdown("Upload a text file or provide a URL")
|
11 |
with gr.Tab("URL"):
|
12 |
with gr.Row():
|
13 |
-
url = gr.Textbox()
|
14 |
-
|
15 |
urlButton = gr.Button("Submit")
|
|
|
16 |
with gr.Tab("Upload File"):
|
17 |
with gr.Row():
|
18 |
upload = gr.File(file_count="multiple",file_types=["text"],label="Upload File")
|
19 |
-
|
20 |
uploadButton = gr.Button("Submit")
|
21 |
-
|
22 |
-
urlButton.click(fn=urlProcess, inputs=url,outputs=urlOutput)
|
23 |
-
uploadButton.click(fn=uploadProcess, inputs=upload,outputs=uploadOutput)
|
24 |
|
25 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
def urlProcess(url,urlQuery):
|
4 |
+
return uploadQuery
|
5 |
|
6 |
+
def uploadProcess(upload,uploadQuery):
|
7 |
+
return uploadQuery
|
8 |
|
9 |
with gr.Blocks() as demo:
|
10 |
gr.Markdown("Upload a text file or provide a URL")
|
11 |
with gr.Tab("URL"):
|
12 |
with gr.Row():
|
13 |
+
url = gr.Textbox(label='URL to be parsed:')
|
14 |
+
urlQuery = gr.Textbox(label='Your query:')
|
15 |
urlButton = gr.Button("Submit")
|
16 |
+
urlOutput = gr.Textbox(label='Results:')
|
17 |
with gr.Tab("Upload File"):
|
18 |
with gr.Row():
|
19 |
upload = gr.File(file_count="multiple",file_types=["text"],label="Upload File")
|
20 |
+
uploadQuery = gr.Textbox(label='Your query:')
|
21 |
uploadButton = gr.Button("Submit")
|
22 |
+
uploadOutput = gr.Textbox()
|
23 |
+
urlButton.click(fn=urlProcess, inputs=[url,urlQuery],outputs=urlOutput)
|
24 |
+
uploadButton.click(fn=uploadProcess, inputs=[upload,uploadQuery],outputs=uploadOutput)
|
25 |
|
26 |
demo.launch()
|