From f0061a9916c5c6cc56b692bd4acc1a99cb66c1d8 Mon Sep 17 00:00:00 2001 From: Ch1y0q Date: Tue, 10 Sep 2024 14:13:24 +0800 Subject: [PATCH] remove local import os to fix Baichuan NPU load issue (#12044) --- python/llm/src/ipex_llm/transformers/npu_model.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/python/llm/src/ipex_llm/transformers/npu_model.py b/python/llm/src/ipex_llm/transformers/npu_model.py index 48df4d48..eeda4ae5 100644 --- a/python/llm/src/ipex_llm/transformers/npu_model.py +++ b/python/llm/src/ipex_llm/transformers/npu_model.py @@ -49,7 +49,6 @@ def save_low_bit(self, model_dir: str, *args, **kwargs): kwargs["safe_serialization"] = False self.save_pretrained(model_dir, *args, **kwargs) import json - import os # We conveniently save all the keys of the model to have them on hand, # so that when using 'low_cpumem load', @@ -391,7 +390,6 @@ class _BaseAutoModelClass: if is_sharded: loaded_state_dict_keys = sharded_metadata["all_checkpoint_keys"] else: - import os import json with open(