File size: 1,207 Bytes
027e6e6
 
 
 
 
 
 
 
 
 
 
 
 
b6a1e5a
0f992a2
b6a1e5a
9c91e2d
 
 
 
 
 
 
 
 
442cf6c
9c91e2d
 
 
 
 
 
 
 
 
 
027e6e6
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
def test():
    import gradio as gr
    
    def analyze_text(text):
        # Lakukan analisis atau pemrosesan teks di sini
        result = f"Anda memasukkan teks: {text}"
        return result
    
    iface = gr.Interface(
        fn=analyze_text,
        inputs=gr.Textbox(),  # Menggunakan input textbox
        outputs="text"  # Menetapkan output ke tipe teks
    )

    iface.launch()

def process():
    import subprocess
    
    # Gantilah "app.py" dengan nama berkas aplikasi Python Anda
    pip_script = "install -r requirements.txt"
    # batch_file_path = "./.run.bat"
    python_script = "entry_with_update.py"
    
    # Argument yang ingin Anda tambahkan
    additional_arguments = ["--in-browser", "--preview-option", "--all-in-fp32", "--directml", "--debug-mode", "--attention-pytorch", "--multi-user", "--always-cpu", "--is-windows-embedded-python"]
    
    # Gabungkan semua argumen
    PIP = ["pip", pip_script]
    command = ["python", python_script] + additional_arguments
    
    # Jalankan skrip menggunakan subprocess
    # subprocess.run(PIP)
    subprocess.run(command)# Menjalankan file batch
    print(command)
    # subprocess.run([batch_file_path], shell=True)

process()