remove local import os to fix Baichuan NPU load issue (#12044)

This commit is contained in:
Ch1y0q 2024-09-10 14:13:24 +08:00 committed by GitHub
parent 640998edea
commit f0061a9916
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -49,7 +49,6 @@ def save_low_bit(self, model_dir: str, *args, **kwargs):
kwargs["safe_serialization"] = False kwargs["safe_serialization"] = False
self.save_pretrained(model_dir, *args, **kwargs) self.save_pretrained(model_dir, *args, **kwargs)
import json import json
import os
# We conveniently save all the keys of the model to have them on hand, # We conveniently save all the keys of the model to have them on hand,
# so that when using 'low_cpumem load', # so that when using 'low_cpumem load',
@ -391,7 +390,6 @@ class _BaseAutoModelClass:
if is_sharded: if is_sharded:
loaded_state_dict_keys = sharded_metadata["all_checkpoint_keys"] loaded_state_dict_keys = sharded_metadata["all_checkpoint_keys"]
else: else:
import os
import json import json
with open( with open(