Skip to content

Commit d72a748

Browse files
committed
Fix HuggingFace token PermissionError when loading embedding model
Pass token=False to SentenceTransformer to skip reading the token file at /root/.cache/huggingface/token, which fails with a PermissionError in Docker. The all-MiniLM-L6-v2 model is public and needs no auth.
1 parent b06be65 commit d72a748

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

backend/reviews/similar_talks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def get_stopwords_for_languages(language_codes: set[str]) -> set[str]:
219219
@functools.cache
220220
def get_embedding_model():
221221
"""Get or create the shared embedding model instance."""
222-
return SentenceTransformer("all-MiniLM-L6-v2")
222+
return SentenceTransformer("all-MiniLM-L6-v2", token=False)
223223

224224

225225
def get_embedding_text(submission) -> str:

0 commit comments

Comments
 (0)