Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bge-small-zh加载错误 #758

Open
sevenandseven opened this issue May 9, 2024 · 1 comment
Open

bge-small-zh加载错误 #758

sevenandseven opened this issue May 9, 2024 · 1 comment

Comments

@sevenandseven
Copy link

sevenandseven commented May 9, 2024

Hello, I downloaded the weights from the Hugging Face mirror, but when loading the model using FlagModel or SentenceTransformer methods, the following issues occur. How can I solve this.

Traceback (most recent call last):
File "/home/ai/anaconda3/envs/langchain_chatchat/lib/python3.10/site-packages/transformers/modeling_utils.py", line 519, in load_state_dict
return torch.load(checkpoint_file, map_location=map_location)
File "/home/ai/anaconda3/envs/langchain_chatchat/lib/python3.10/site-packages/torch/serialization.py", line 815, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/home/ai/anaconda3/envs/langchain_chatchat/lib/python3.10/site-packages/torch/serialization.py", line 1033, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, 'v'.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/media/ai/HDD/Teamwork/FlagEmbedding-master/test/test_bge_small.py", line 32, in
model = FlagModel('/media/ai/HDD/Teamwork/LLM_Embedding_model/Embedding/bge-small-zh', query_instruction_for_retrieval="", )
File "/home/ai/anaconda3/envs/langchain_chatchat/lib/python3.10/site-packages/FlagEmbedding/flag_models.py", line 20, in init
self.model = AutoModel.from_pretrained(model_name_or_path)
File "/home/ai/anaconda3/envs/langchain_chatchat/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 566, in from_pretrained
return model_class.from_pretrained(
File "/home/ai/anaconda3/envs/langchain_chatchat/lib/python3.10/site-packages/transformers/modeling_utils.py", line 3393, in from_pretrained
state_dict = load_state_dict(resolved_archive_file)
File "/home/ai/anaconda3/envs/langchain_chatchat/lib/python3.10/site-packages/transformers/modeling_utils.py", line 524, in load_state_dict
raise OSError(
OSError: You seem to have cloned a repository without having git-lfs installed. Please install git-lfs and run git lfs install followed by git lfs pull in the folder you cloned.

@staoxiao
Copy link
Collaborator

staoxiao commented May 9, 2024

Hi, @sevenandseven , It looks like you haven't downloaded the model files correctly(OSError: You seem to have cloned a repository without having git-lfs installed. Please install git-lfs and run git lfs install followed by git lfs pull in the folder you cloned.). You can refer to this link: https://hf-mirror.com/ to learn how to download the model from hf mirror.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants