Skip to content

Commit 7c78810

Browse files
committed
Merge branch 'main' of https://github.com/sdpython/onnx-diagnostic into qwnenpulg
2 parents 621e81e + d75d0aa commit 7c78810

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

CHANGELOGS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Change Logs
44
0.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

onnx_diagnostic/helpers/model_builder_helper.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)