Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def dynamic_file_download():
|
| 4 |
+
# This could be a dynamically generated file content
|
| 5 |
+
file_content = "Dynamically generated content."
|
| 6 |
+
return "dynamic_file.txt", file_content
|
| 7 |
+
|
| 8 |
+
iface = gr.Interface(
|
| 9 |
+
fn=lambda x: x, # Placeholder function for the interface
|
| 10 |
+
inputs=gr.Textbox(), # Example input component
|
| 11 |
+
outputs=gr.DownloadButton(label="📂 Click to download dynamically generated file", value=dynamic_file_download)
|
| 12 |
+
)
|
| 13 |
+
|
| 14 |
+
iface.launch()
|