0xharib commited on
Commit
63b706d
·
1 Parent(s): 50acacd

Added Queries

Browse files
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -1,25 +1,26 @@
1
  import gradio as gr
2
 
3
- def urlProcess(webLink):
4
- return 'Weblink'
5
 
6
- def uploadProcess(upload):
7
- return 'File'
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
- urlOutput = gr.Textbox()
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
- uploadOutput = gr.Textbox()
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()