Skip to content

Commit 8308a65

Browse files
authored
Remove hardcoded trust_remote_code.
Signed-off-by: Muti Chung <mtchung037@gmail.com>
1 parent 912ec8d commit 8308a65

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/llmcompressor/modifiers/awq/convert_autoawq.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
from huggingface_hub import load_state_dict_from_file, snapshot_download
2424

2525

26-
def is_autoawq_model(model_path: Path) -> bool:
27-
config = transformers.AutoConfig.from_pretrained(model_path, trust_remote_code=True)
26+
def is_autoawq_model(model_path: Path, trust_remote_code: bool = False) -> bool:
27+
config = transformers.AutoConfig.from_pretrained(model_path, trust_remote_code=trust_remote_code)
2828
if not hasattr(config, "quantization_config"):
2929
return False
3030

@@ -163,7 +163,7 @@ def convert_and_save(
163163
)
164164

165165
model_path = resolve_model_path(model_name_or_path)
166-
if not is_autoawq_model(model_path):
166+
if not is_autoawq_model(model_path, trust_remote_code):
167167
raise ValueError("Model is not an AutoAWQ model")
168168

169169
config = transformers.AutoConfig.from_pretrained(

0 commit comments

Comments
 (0)