Skip to content

SentenceTransformer加载模型的错误警告和输出精度问题 #1815

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

Closed
ResDream opened this issue Nov 13, 2024 · 1 comment · Fixed by #1873
Closed

SentenceTransformer加载模型的错误警告和输出精度问题 #1815

ResDream opened this issue Nov 13, 2024 · 1 comment · Fixed by #1873
Labels
bug Something isn't working

Comments

@ResDream
Copy link
Contributor

ResDream commented Nov 13, 2024

Describe the bug/ 问题描述 (Mandatory / 必填)
在使用SentenceTransformer时,正确下载并加载了模型,仍然弹出警告:No sentence-transformers model found with name BAAI/bge-large-zh-v1.5. Creating a new one with MEAN pooling
与PyTorch相比输出差别有点大

  • Hardware Environment(Ascend/GPU/CPU) / 硬件环境:
    ascend和CPU都存在这个问题

  • Software Environment / 软件环境 (Mandatory / 必填):
    -- MindSpore version: 2.4.0和2.3.1
    -- Python version: 3.10
    -- OS platform and distribution: Linux和Windows

To Reproduce / 重现步骤 (Mandatory / 必填)

from mindnlp.sentence import SentenceTransformer
model = SentenceTransformer('BAAI/bge-large-zh-v1.5')
sentences_1 = "The weather is lovely today."
sentences_2 = "It's so sunny outside!"
embeddings_1 = model.encode(sentences_1, normalize_embeddings=True)
embeddings_2 = model.encode(sentences_2, normalize_embeddings=True)
similarity = embeddings_1 @ embeddings_2.T
print(similarity)
from sentence_transformers import SentenceTransformer
model = SentenceTransformer('BAAI/bge-large-zh-v1.5')
sentences_1 = "The weather is lovely today."
sentences_2 = "It's so sunny outside!"
embeddings_1 = model.encode(sentences_1, normalize_embeddings=True)
embeddings_2 = model.encode(sentences_2, normalize_embeddings=True)
similarity = embeddings_1 @ embeddings_2.T
print(similarity)

Expected behavior / 预期结果 (Mandatory / 必填)
A clear and concise description of what you expected to happen.

Screenshots/ 日志 / 截图 (Mandatory / 必填)
If applicable, add screenshots to help explain your problem.
97d0d0b6565a5fff0751a9c25519bafe

Additional context / 备注 (Optional / 选填)
Add any other context about the problem here.

@ResDream ResDream added the bug Something isn't working label Nov 13, 2024
@lvyufeng lvyufeng linked a pull request Dec 19, 2024 that will close this issue
@lvyufeng
Copy link
Collaborator

fixed

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

Successfully merging a pull request may close this issue.

2 participants