Spaces:
Runtime error
Runtime error
Download app.py from wasmdashai/dowload_file: direct link, hf CLI and curl.
- Browser
- Download file 654 Bytes
-
https://huggingface.co/spaces/wasmdashai/dowload_file/resolve/main/app.py
- Command line
-
hf download hf://spaces/wasmdashai/dowload_file/app.py
-
curl -L -o app.py https://huggingface.co/spaces/wasmdashai/dowload_file/resolve/main/app.py
654 Bytes
| import gradio as gr | |
| !unzip VitsModelSplit.zip | |
| def create_and_download_file(): | |
| # تحديد مسار الملف | |
| file_path = "/tmp/my_file.txt" | |
| # كتابة المحتوى إلى الملف | |
| with open(file_path, "w") as file: | |
| file.write("This is a file created in Gradio.\n") | |
| file.write("You can download it after creation.\n") | |
| # إرجاع مسار الملف لتنزيله | |
| return file_path | |
| # إنشاء واجهة Gradio للسماح بتنزيل الملف | |
| iface = gr.Interface(fn=create_and_download_file, inputs=[], outputs=gr.File(label="Download File")) | |
| # تشغيل التطبيق | |
| iface.launch() | |