Spaces:
Runtime error
Runtime error
Apple
commited on
Commit
·
742be9d
1
Parent(s):
ace93f0
Initial CADCoder Space with Gradio
Browse files
app.py
CHANGED
|
@@ -1,14 +1,17 @@
|
|
| 1 |
import os, sys, subprocess
|
| 2 |
|
|
|
|
|
|
|
|
|
|
| 3 |
# Clone CADFusion repo if not already cloned
|
| 4 |
-
if not os.path.exists(
|
| 5 |
-
subprocess.check_call(["git", "clone", "https://github.com/microsoft/CADFusion.git"])
|
| 6 |
|
| 7 |
# Add CADFusion repo to Python path
|
| 8 |
-
sys.path.append(
|
| 9 |
|
| 10 |
# Now import from repo
|
| 11 |
-
from models import CADFusionModel #
|
| 12 |
|
| 13 |
import gradio as gr
|
| 14 |
import torch
|
|
|
|
| 1 |
import os, sys, subprocess
|
| 2 |
|
| 3 |
+
# Path where CADFusion repo should be cloned
|
| 4 |
+
cadfusion_repo = os.path.join(os.path.dirname(__file__), "CADFusion")
|
| 5 |
+
|
| 6 |
# Clone CADFusion repo if not already cloned
|
| 7 |
+
if not os.path.exists(cadfusion_repo):
|
| 8 |
+
subprocess.check_call(["git", "clone", "https://github.com/microsoft/CADFusion.git", cadfusion_repo])
|
| 9 |
|
| 10 |
# Add CADFusion repo to Python path
|
| 11 |
+
sys.path.append(cadfusion_repo)
|
| 12 |
|
| 13 |
# Now import from repo
|
| 14 |
+
from models import CADFusionModel # models.py lives inside the cloned repo
|
| 15 |
|
| 16 |
import gradio as gr
|
| 17 |
import torch
|