Spaces:
Runtime error
Runtime error
PepeLevi commited on
Commit ·
99fcaac
1
Parent(s): 3bc2ae5
1234567891011121314151617181920212223242526271 unmodified line29303132333435import gradio as grimport subprocessimport osimport requests# Function to download the modeldef download_model(url, local_path):if not os.path.exists(local_path):response = requests.get(url)with open(local_path, 'wb') as f:f.write(response.content)# Define the function to generate imagesdef generate_images(seeds, trunc):# Define the URL for the modelNETWORK_PATH = 'https://huggingface.co/gaarafacehugger/deformedIDs/resolve/main/network-snapshot-000064.pkl?download=true'# Define the output directoryOUTPUT_DIR = 'images/'# Ensure the output directory existsos.makedirs(OUTPUT_DIR, exist_ok=True)# Download the modeldownload_model(NETWORK_PATH, OUTPUT_DIR + 'network-snapshot-000064.pkl')# Run the Python script for generating imagescommand = [1 unmodified line'--outdir', OUTPUT_DIR,'--trunc', str(trunc),'--seeds', seeds,'--network', OUTPUT_DIR + 'network-snapshot-000064.pkl']subprocess.run(command, check=True)123456789101112131415161 unmodified line18192021222324import gradio as grimport subprocessimport os# Define the function to generate imagesdef generate_images(seeds, trunc):# Define the path to the modelNETWORK_PATH = 'network-snapshot-000064.pkl'# Define the output directoryOUTPUT_DIR = 'images/'# Ensure the output directory existsos.makedirs(OUTPUT_DIR, exist_ok=True)# Run the Python script for generating imagescommand = [1 unmodified line'--outdir', OUTPUT_DIR,'--trunc', str(trunc),'--seeds', seeds,'--network', NETWORK_PATH]subprocess.run(command, check=True)
app.py+3-14