fix optimize_model not working (#9995)

This commit is contained in:
Chen, Zhentao 2024-01-25 16:39:05 +08:00 committed by GitHub
parent 9bff84e6fd
commit 86055d76d5

View file

@ -47,8 +47,8 @@ class BigDLLM(AutoCausalLM):
if k not in self.AutoCausalLM_ARGS: if k not in self.AutoCausalLM_ARGS:
self.bigdl_llm_kwargs[k] = kwargs.pop(k) self.bigdl_llm_kwargs[k] = kwargs.pop(k)
self.bigdl_llm_kwargs['use_cache'] = kwargs.get('use_cache', True) self.bigdl_llm_kwargs['use_cache'] = self.bigdl_llm_kwargs.get('use_cache', True)
self.bigdl_llm_kwargs['optimize_model'] = kwargs.get('optimize_model', True) self.bigdl_llm_kwargs['optimize_model'] = self.bigdl_llm_kwargs.get('optimize_model', True)
AutoModelForCausalLM.from_pretrained = partial(AutoModelForCausalLM.from_pretrained, **self.bigdl_llm_kwargs) AutoModelForCausalLM.from_pretrained = partial(AutoModelForCausalLM.from_pretrained, **self.bigdl_llm_kwargs)
kwargs['trust_remote_code'] = kwargs.get('trust_remote_code', True) kwargs['trust_remote_code'] = kwargs.get('trust_remote_code', True)