File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ Change Logs
440.8.3
55+++++
66
7+ * :pr: `314 `: fix modelbuilder download needed after this change https://github.com/microsoft/onnxruntime-genai/pull/1862
78* :pr: `311 `: use custom and local function to use PackedMultiHeadAttention from onnxruntime
89* :pr: `310 `: splits patches into multiple files
910* :pr: `308 `: add option --save_ep to dump the exported program as well as torch input
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