FreedomIntelligence / HuatuoGPT

HuatuoGPT, Towards Taming Language Models To Be a Doctor. (An Open Medical GPT)
Apache License 2.0
1.08k stars 142 forks source link

ValueError: Loading 模型路径 requires you to execute the configuration file in that repo on your local machine. Make sure you have read the code there to avoid malicious use, then set the option `trust_remote_code=True` to remove this error. #26

Closed liuzhen9327 closed 1 year ago

liuzhen9327 commented 1 year ago

代码已经加了 trust_remote_code=True tokenizer = AutoTokenizer.from_pretrained(model_name, padding_side="right", use_fast=True, trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained(model_name, low_cpu_mem_usage=True, **kwargs)

delamoer commented 1 year ago

我遇到了相同的问题,请问你是怎么解决的呢

ll0ruc commented 1 year ago

在加载模型的AutoModelForCausaLM.from_pretrained()里面也设置trust_remote_code=True