File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -28,10 +28,37 @@ def download_model_builder_to_cache(
2828 if file_path .exists ():
2929 return file_path
3030
31+ builders = cache_dir / "builders"
32+ if not builders .exists ():
33+ builders .mkdir (parents = True , exist_ok = True )
34+
35+ for subfile in [
36+ "__init__.py" ,
37+ "base.py" ,
38+ "chatglm.py" ,
39+ "ernie.py" ,
40+ "gemma.py" ,
41+ "gptoss.py" ,
42+ "granite.py" ,
43+ "llama.py" ,
44+ "mistral.py" ,
45+ "nemotron.py" ,
46+ "olmo.py" ,
47+ "phi.py" ,
48+ "qwen.py" ,
49+ "smollm.py" ,
50+ ]:
51+ u = f"{ '/' .join (url .split ('/' )[:- 1 ])} /builders/{ subfile } "
52+ response = requests .get (u )
53+ response .raise_for_status ()
54+ with open (builders / subfile , "wb" ) as f :
55+ f .write (response .content )
56+
3157 response = requests .get (url )
3258 response .raise_for_status ()
3359 with open (file_path , "wb" ) as f :
3460 f .write (response .content )
61+
3562 return file_path
3663
3764
You can’t perform that action at this time.
0 commit comments