trcprogrammer commited on
Commit
65407a0
verified
1 Parent(s): 0ed307f

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +36 -0
app.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import subprocess
3
+ import gradio as gr
4
+
5
+ # Crear una carpeta para el proyecto
6
+ project_dir = "my_project"
7
+ if not os.path.exists(project_dir):
8
+ os.makedirs(project_dir)
9
+
10
+ # Cambiar al directorio del proyecto
11
+ os.chdir(project_dir)
12
+
13
+ # Crear y activar un entorno virtual (esto es para asegurarte de que los paquetes se instalen correctamente)
14
+ subprocess.run(["python3", "-m", "venv", "venv"])
15
+ subprocess.run(["source", "venv/bin/activate"], shell=True)
16
+
17
+ # Instalar dependencias
18
+ subprocess.run(["pip", "install", "--upgrade", "pip", "setuptools", "wheel"])
19
+ subprocess.run(["pip", "install", "pygit2==1.15.1", "packaging", "gitpython", "requests", "numpy", "pandas"])
20
+
21
+ # Clonar el repositorio desde GitHub
22
+ if not os.path.exists("Fooocus"):
23
+ subprocess.run(["git", "clone", "https://github.com/lllyasviel/Fooocus.git"])
24
+
25
+ # Cambiar al directorio del repositorio clonado
26
+ os.chdir("Fooocus")
27
+
28
+ # Ejecutar el script Python
29
+ subprocess.run(["python", "entry_with_update.py", "--share", "--always-high-vram"])
30
+
31
+ # Definir la aplicaci贸n Gradio
32
+ def greet(name):
33
+ return f"Hello {name}!!"
34
+
35
+ demo = gr.Interface(fn=greet, inputs="text", outputs="text")
36
+ demo.launch()