mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
No such file or directory with --use_external_data_form and int8 (#6867)
Implemented following change to avoid the error when using both --use_external_data_form and --precision int8 with GPT2LMHeadModel, which results in line 161, in save_external_data; open(external_data_file_path, 'ab').close() FileNotFoundError: [Errno 2] No such file or directory: This may also be related to the identified bug #6047.
This commit is contained in:
parent
679718b12f
commit
107c9672fd
1 changed files with 1 additions and 0 deletions
|
|
@ -68,6 +68,7 @@ class QuantizeHelper:
|
|||
|
||||
if use_external_data_format:
|
||||
from pathlib import Path
|
||||
Path(quantized_model_path).parent.mkdir(parents=True, exist_ok=True)
|
||||
onnx.external_data_helper.convert_model_to_external_data(quantized_onnx_model,
|
||||
all_tensors_to_one_file=True,
|
||||
location=Path(quantized_model_path).name + ".data")
|
||||
|
|
|
|||
Loading…
Reference in a new issue