Spaces:
Sleeping
Sleeping
Moving to tabs
Browse files
app.py
CHANGED
@@ -1,18 +1,25 @@
|
|
1 |
import gradio as gr
|
2 |
|
|
|
|
|
3 |
|
4 |
-
def
|
5 |
-
|
6 |
-
return 'File'
|
7 |
-
else:
|
8 |
-
return 'Weblink'
|
9 |
|
10 |
with gr.Blocks() as demo:
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
demo.launch()
|
|
|
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()
|