Apple commited on
Commit
742be9d
·
1 Parent(s): ace93f0

Initial CADCoder Space with Gradio

Browse files
Files changed (1) hide show
  1. app.py +7 -4
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("CADFusion"):
5
- subprocess.check_call(["git", "clone", "https://github.com/microsoft/CADFusion.git"])
6
 
7
  # Add CADFusion repo to Python path
8
- sys.path.append("CADFusion")
9
 
10
  # Now import from repo
11
- from models import CADFusionModel # repo folder has `models.py`
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