Fix HuggingFace token PermissionError in similar talks#4568
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This PR adds Issues FoundMissing Test CoverageThe fix is not tested. The existing tests in Recommendation: Add a test that verifies 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 CompletedThe PR test plan checkbox is unchecked. Before merging, verify the fix works by triggering the review recap analysis view at |
Codecov Report❌ Patch coverage is 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:
|
Summary
Test plan