File size: 1,021 Bytes
adcf4a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import subprocess
import sys
import os

def install_dependencies():
    """

    Install required dependencies from requirements.txt

    """
    print("Installing dependencies...")
    try:
        subprocess.run([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"], check=True)
        print("Dependencies installed successfully!")
    except subprocess.CalledProcessError as e:
        print(f"Error installing dependencies: {e}")
        sys.exit(1)

def run_main_script():
    """

    Run the main gradio script

    """
    print("Starting PIXE 3.5 Image Generator...")
    try:
        subprocess.run([sys.executable, "main_gr.py"], check=True)
    except subprocess.CalledProcessError as e:
        print(f"Error running main script: {e}")
        sys.exit(1)

if __name__ == "__main__":
    print("PIXE 3.5 Setup")
    print("===============")
    
    # Install dependencies first
    install_dependencies()
    
    # Run the main application
    run_main_script()