Skip to content

Comments

Fix HuggingFace token PermissionError in similar talks#4568

Merged
patrick91 merged 1 commit intomainfrom
fix/huggingface-token-permission-error
Feb 9, 2026
Merged

Fix HuggingFace token PermissionError in similar talks#4568
patrick91 merged 1 commit intomainfrom
fix/huggingface-token-permission-error

Conversation

@patrick91
Copy link
Member

Summary

  • Pass token=False to SentenceTransformer in get_embedding_model() to prevent it from reading /root/.cache/huggingface/token, which fails with a PermissionError inside Docker
  • The all-MiniLM-L6-v2 model is public and does not require authentication

Test plan

  • Trigger the review recap analysis view and verify the embedding model loads without a PermissionError

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.
@vercel
Copy link

vercel bot commented Feb 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pycon Ready Ready Preview Feb 9, 2026 1:27pm

@claude
Copy link
Contributor

claude bot commented Feb 9, 2026

This PR adds token=False to prevent HuggingFace from attempting to read authentication tokens for a public model, fixing a PermissionError in Docker environments.

Issues Found

Missing Test Coverage

The fix is not tested. The existing tests in backend/reviews/tests/test_similar_talks.py mock get_embedding_model() entirely, so they won't verify that the token=False parameter is actually passed to SentenceTransformer.

Recommendation: Add a test that verifies SentenceTransformer is called with token=False:

def test_embedding_model_does_not_use_token():
    with patch('reviews.similar_talks.SentenceTransformer') as mock_st:
        get_embedding_model()
        mock_st.assert_called_once_with('all-MiniLM-L6-v2', token=False)

This would ensure the fix doesn't regress and documents the requirement.

Test Plan Not Completed

The PR test plan checkbox is unchecked. Before merging, verify the fix works by triggering the review recap analysis view at /admin/reviews/reviewsession/<id>/review/recap/ and confirming no PermissionError occurs when computing analysis.

@patrick91 patrick91 merged commit 3cbed04 into main Feb 9, 2026
8 checks passed
@patrick91 patrick91 deleted the fix/huggingface-token-permission-error branch February 9, 2026 13:27
@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.50%. Comparing base (b06be65) to head (d72a748).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4568   +/-   ##
=======================================
  Coverage   92.50%   92.50%           
=======================================
  Files         355      355           
  Lines       10658    10658           
  Branches      812      812           
=======================================
  Hits         9859     9859           
  Misses        687      687           
  Partials      112      112           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Successfully merging this pull request may close these issues.

1 participant