Spaces:
Runtime error
Runtime error
| 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() | |