File size: 654 Bytes
4f394eb
017f73b
616ff4e
 
 
7d54bec
616ff4e
 
 
 
7d54bec
616ff4e
 
6804d36
616ff4e
 
6804d36
616ff4e
4f394eb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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()