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

macbook support? #3209

Open
CrackedResearcher opened this issue Feb 2, 2025 · 1 comment
Open

macbook support? #3209

CrackedResearcher opened this issue Feb 2, 2025 · 1 comment

Comments

@CrackedResearcher
Copy link

will this be able to run locally on macbook air m1 2020 model or we would need to deploy it on cloud?

@tomaarsen
Copy link
Collaborator

Hello!

It should run locally just fine, for example:

# pip install sentence-transformers
from sentence_transformers import SentenceTransformer

model = SentenceTransformer("sentence-transformers/all-MiniLM-L6-v2")

sentences = [
    "That is a happy person",
    "That is a happy dog",
    "That is a very happy person",
    "Today is a sunny day"
]
embeddings = model.encode(sentences)

similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]

You can use any model from here: https://huggingface.co/models?library=sentence-transformers
(There might be a handful of exceptions, as some models use custom code that only runs on CUDA)

  • Tom Aarsen

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