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

微调后模型保存和load的问题 #117

Open
LeiShenVictoria opened this issue Dec 15, 2023 · 3 comments
Open

微调后模型保存和load的问题 #117

LeiShenVictoria opened this issue Dec 15, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@LeiShenVictoria
Copy link

🐛 bug 说明

  1. 微调后finetuned-model/model下没有保存pytorch_model.bin文件,仅有:
    config.json
    model.safetensors
    special_tokens_map.json
    tokenizer.json
    tokenizer_config.json
    vocab.txt
    这是否正常呢
  2. 使用微调后的模型生成向量的时候,model=SentenceTransformer("finetuned-model/model") 提示:No sentence-transformers model found with name finetuned-model/model. Creating a new one with MEAN pooling

Python Version

3.10

@LeiShenVictoria LeiShenVictoria added the bug Something isn't working label Dec 15, 2023
@BaoyanWang
Copy link

同样遇到没有保存pytorch_model.bin文件~

@wangyuxinwhy
Copy link
Owner

  1. 我猜 transformers 的新版本模型权重只会保存 model.safetensors ,不再保存 pytorch_model.bin
  2. 这个提示是正常的,因为保存的格式不是 sentence_transformers 的,不过推理起来都是正确的。您可以再次调用 sentence_transformers 库的保存模型方法,保存一个 sentence_transformers 的模型。

@yinxuemei
Copy link

在python 310 环境下重新安装sentence_transformers版本就可以加载模型了,!pip install uniem sentence_transformers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants