Skip to content

Commit a147a51

Browse files
committed
Add missing trust_remote_codes.
Signed-off-by: Muti Chung <mtchung037@gmail.com>
1 parent 2d11f50 commit a147a51

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/llmcompressor/modifiers/awq/convert_autoawq.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@ def convert_and_save(
254254
compressed_state_dict = compressor.compress(model, state_dict, show_progress=True)
255255

256256
# 6. Save the model.
257-
tokenizer = transformers.AutoTokenizer.from_pretrained(model_name_or_path)
257+
tokenizer = transformers.AutoTokenizer.from_pretrained(
258+
model_name_or_path, trust_remote_code=trust_remote_code
259+
)
258260
model.save_pretrained(output_dir, state_dict=compressed_state_dict)
259261
tokenizer.save_pretrained(output_dir)
260262
compressor.update_config(output_dir)
@@ -274,7 +276,12 @@ def load_and_convert_from_autoawq(
274276
:return: A compressed model.
275277
"""
276278
with TemporaryDirectory() as temp_dir:
277-
convert_and_save(model_name_or_path, temp_dir, quantization_format)
279+
convert_and_save(
280+
model_name_or_path,
281+
temp_dir,
282+
quantization_format,
283+
trust_remote_code=trust_remote_code,
284+
)
278285
return transformers.AutoModelForCausalLM.from_pretrained(
279286
temp_dir, torch_dtype=torch.float16, trust_remote_code=trust_remote_code
280287
)

0 commit comments

Comments
 (0)