kshdes37 commited on
Commit
e0d1fbf
·
verified ·
1 Parent(s): 91daf98

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -0
app.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import sys
2
+ from pathlib import Path
3
+
4
+ # Add CADFusion repo to Python path
5
+ CADFUSION_DIR = Path("CADFusion")
6
+ sys.path.append(str(CADFUSION_DIR))
7
+
8
+ from cadfusion.inference import InferenceRunner
9
+ from cadfusion.utils.config import load_config
10
+
11
+ # Use HF Hub to download adapter config & checkpoint
12
+ from huggingface_hub import hf_hub_download
13
+
14
+ CONFIG_PATH = hf_hub_download(
15
+ repo_id="microsoft/CADFusion",
16
+ filename="adapter_config.json",
17
+ revision="v1_1"
18
+ )
19
+
20
+ CHECKPOINT_PATH = hf_hub_download(
21
+ repo_id="microsoft/CADFusion",
22
+ filename="adapter_model.safetensors",
23
+ revision="v1_1"
24
+ )
25
+
26
+ # Initialize runner
27
+ config = load_config(CONFIG_PATH)
28
+ runner = InferenceRunner(config=config)
29
+ runner.load_checkpoint(CHECKPOINT_PATH)