[LLM] Add trust_remote_code for local renamed model in bigdl_llm_model.py (#9762)

This commit is contained in:
Ziteng Zhang 2023-12-25 11:31:14 +08:00 committed by GitHub
parent be13b162fe
commit 986f65cea9

View file

@ -243,7 +243,7 @@ class BigDLLLMAdapter(BaseModelAdapter):
def load_model(self, model_path: str, from_pretrained_kwargs: dict):
revision = from_pretrained_kwargs.get("revision", "main")
tokenizer = AutoTokenizer.from_pretrained(
model_path, use_fast=False, revision=revision
model_path, use_fast=False, revision=revision, trust_remote_code=True
)
print("Customized bigdl-llm loader")
from bigdl.llm.transformers import AutoModelForCausalLM