Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,21 +2,21 @@ import subprocess
|
|
| 2 |
import sys
|
| 3 |
from pathlib import Path
|
| 4 |
|
| 5 |
-
#
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
|
| 10 |
-
|
| 11 |
-
# Build and install gradio_molecule3d
|
| 12 |
print("Building gradio_molecule3d...")
|
| 13 |
subprocess.run(["gradio", "cc", "build"], cwd=Path(__file__).parent / "gradio_molecule3d/", check=True)
|
| 14 |
-
print("Installing gradio_molecule3d...")
|
| 15 |
-
whl_file = list((Path(__file__).parent / "gradio_molecule3d" / "dist").glob("*.whl"))[0]
|
| 16 |
-
subprocess.run([sys.executable, "-m", "pip", "install", str(whl_file)], check=True)
|
| 17 |
-
print("gradio_molecule3d installed successfully")
|
| 18 |
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
import os
|
| 21 |
os.environ["TORCH_DYNAMO_DISABLE"] = "1"
|
| 22 |
import tempfile
|
|
|
|
| 2 |
import sys
|
| 3 |
from pathlib import Path
|
| 4 |
|
| 5 |
+
# Instalar dependencias npm primero
|
| 6 |
+
print("Installing npm dependencies...")
|
| 7 |
+
frontend_path = Path(__file__).parent / "gradio_molecule3d" / "frontend"
|
| 8 |
+
subprocess.run(["npm", "install"], cwd=frontend_path, check=True)
|
| 9 |
|
| 10 |
+
# Ahora compilar
|
|
|
|
| 11 |
print("Building gradio_molecule3d...")
|
| 12 |
subprocess.run(["gradio", "cc", "build"], cwd=Path(__file__).parent / "gradio_molecule3d/", check=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
+
print("Installing wheel...")
|
| 15 |
+
whl_files = list((Path(__file__).parent / "gradio_molecule3d" / "dist").glob("*.whl"))
|
| 16 |
+
if whl_files:
|
| 17 |
+
subprocess.run([sys.executable, "-m", "pip", "install", str(whl_files[0])], check=True)
|
| 18 |
+
|
| 19 |
+
# Ahora sí, imports
|
| 20 |
import os
|
| 21 |
os.environ["TORCH_DYNAMO_DISABLE"] = "1"
|
| 22 |
import tempfile
|