Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,15 +26,15 @@ def upload_file(filepath):
|
|
| 26 |
file_url = f"{space_url}/gradio_api/file={filepath[0]}"
|
| 27 |
print(f"File URL: {file_url}")
|
| 28 |
|
| 29 |
-
return filepath[0]
|
| 30 |
|
| 31 |
with gr.Blocks() as demo:
|
| 32 |
gr.Markdown("## Using gr.File")
|
| 33 |
with gr.Row():
|
| 34 |
f_in = gr.File(label="Upload a file", file_count="multiple")
|
| 35 |
-
f_out = gr.File(label="Output file", file_count="multiple")
|
| 36 |
file_url = gr.Textbox(label="file_url")
|
| 37 |
|
| 38 |
-
f_in.upload(upload_file, f_in,
|
| 39 |
|
| 40 |
demo.launch(debug=True, mcp_server=True)
|
|
|
|
| 26 |
file_url = f"{space_url}/gradio_api/file={filepath[0]}"
|
| 27 |
print(f"File URL: {file_url}")
|
| 28 |
|
| 29 |
+
return file_url #filepath[0]
|
| 30 |
|
| 31 |
with gr.Blocks() as demo:
|
| 32 |
gr.Markdown("## Using gr.File")
|
| 33 |
with gr.Row():
|
| 34 |
f_in = gr.File(label="Upload a file", file_count="multiple")
|
| 35 |
+
#f_out = gr.File(label="Output file", file_count="multiple")
|
| 36 |
file_url = gr.Textbox(label="file_url")
|
| 37 |
|
| 38 |
+
f_in.upload(upload_file, f_in, file_url, api_name="output_file_url")
|
| 39 |
|
| 40 |
demo.launch(debug=True, mcp_server=True)
|