Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,37 +3,28 @@ import gradio as gr
|
|
| 3 |
|
| 4 |
css = """.hamburger-button {
|
| 5 |
width: 30px !important;
|
| 6 |
-
/*max-width: auto !important;*/
|
| 7 |
background-color: transparent !important;
|
| 8 |
-
/*color: black !important;*/
|
| 9 |
border: none !important;
|
| 10 |
-
/*font-weight: 400 !important;*/
|
| 11 |
-
/*font-size: var(--text_md) !important;*/
|
| 12 |
-
/*box-shadow: none !important;*/
|
| 13 |
-
/*text-align: left !important;*/
|
| 14 |
-
/*justify-content: right !important;*/
|
| 15 |
padding: 0 !important;
|
| 16 |
-
/*margin-left: 10px !important;*/
|
| 17 |
outline: none !important;
|
| 18 |
}"""
|
| 19 |
|
| 20 |
def upload_file(filepath):
|
| 21 |
name = Path(filepath).name
|
| 22 |
return [gr.UploadButton(interactive=False, icon='icon4.png',),
|
| 23 |
-
gr.DownloadButton( value=filepath, interactive=True)] #label=f"Download {name}",
|
| 24 |
|
| 25 |
def download_file():
|
| 26 |
return [gr.UploadButton(interactive=True), gr.DownloadButton(interactive=False, icon='icon1.png',)]
|
| 27 |
|
| 28 |
with gr.Blocks(css=css,
|
| 29 |
-
theme=gr.themes.Base(radius_size=gr.themes.sizes.radius_none,
|
| 30 |
-
spacing_size="sm")) as demo:
|
| 31 |
tb = gr.Textbox(value = "First upload a file and and then you'll be able download it (but only once!)")
|
| 32 |
with gr.Row():
|
| 33 |
with gr.Column(scale=1):
|
| 34 |
-
u = gr.UploadButton(icon='icon3.png', elem_classes="hamburger-button", label="", file_count="single", size='
|
| 35 |
with gr.Column(scale=1):
|
| 36 |
-
d = gr.DownloadButton( icon='
|
| 37 |
with gr.Column(scale=8):
|
| 38 |
t = gr.Textbox(visible=False, )
|
| 39 |
|
|
|
|
| 3 |
|
| 4 |
css = """.hamburger-button {
|
| 5 |
width: 30px !important;
|
|
|
|
| 6 |
background-color: transparent !important;
|
|
|
|
| 7 |
border: none !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
padding: 0 !important;
|
|
|
|
| 9 |
outline: none !important;
|
| 10 |
}"""
|
| 11 |
|
| 12 |
def upload_file(filepath):
|
| 13 |
name = Path(filepath).name
|
| 14 |
return [gr.UploadButton(interactive=False, icon='icon4.png',),
|
| 15 |
+
gr.DownloadButton( value=filepath, interactive=True, icon='icon2.png',)] #label=f"Download {name}",
|
| 16 |
|
| 17 |
def download_file():
|
| 18 |
return [gr.UploadButton(interactive=True), gr.DownloadButton(interactive=False, icon='icon1.png',)]
|
| 19 |
|
| 20 |
with gr.Blocks(css=css,
|
| 21 |
+
theme=gr.themes.Base(radius_size=gr.themes.sizes.radius_none,)) as demo:
|
|
|
|
| 22 |
tb = gr.Textbox(value = "First upload a file and and then you'll be able download it (but only once!)")
|
| 23 |
with gr.Row():
|
| 24 |
with gr.Column(scale=1):
|
| 25 |
+
u = gr.UploadButton(icon='icon3.png', elem_classes="hamburger-button", label="", file_count="single", size='sm')
|
| 26 |
with gr.Column(scale=1):
|
| 27 |
+
d = gr.DownloadButton( icon='icon1.png', elem_classes="hamburger-button", label="", interactive=False, size='sm')
|
| 28 |
with gr.Column(scale=8):
|
| 29 |
t = gr.Textbox(visible=False, )
|
| 30 |
|