Skip to content

Fix HF cache permissions and add startup fallback#677

Open
enveryasar wants to merge 1 commit into
jamiepine:mainfrom
enveryasar:fix/hf-cache-permission
Open

Fix HF cache permissions and add startup fallback#677
enveryasar wants to merge 1 commit into
jamiepine:mainfrom
enveryasar:fix/hf-cache-permission

Conversation

@enveryasar
Copy link
Copy Markdown

@enveryasar enveryasar commented May 18, 2026

Summary by CodeRabbit

  • Chores
    • Improved Hugging Face model cache initialization with automatic directory setup during startup
    • Added graceful fallback handling if cache directory creation fails
    • Updated container environment configuration for cache directory paths

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5b08a9e3-0ea5-4c25-a5a1-35053e64381b

📥 Commits

Reviewing files that changed from the base of the PR and between b35b909 and 59a1ed7.

📒 Files selected for processing (2)
  • backend/app.py
  • docker-compose.yml

📝 Walkthrough

Walkthrough

Backend startup now sets a Hugging Face hub cache fallback directory under the app's configured cache path when HF_HUB_CACHE is not already set, creating it with graceful error handling. Docker Compose configuration is updated to expose this environment variable and removes the corresponding named volume.

Changes

Hugging Face Hub Cache Setup

Layer / File(s) Summary
Backend HF cache environment and directory setup
backend/app.py
Startup computes and sets HF_HUB_CACHE fallback directory under the app's configured cache directory, then creates the directory with graceful error handling that logs a warning without aborting startup if directory creation fails.
Docker Compose HF cache environment configuration
docker-compose.yml
Environment variable HF_HUB_CACHE is set in the voicebox service to point to the cache directory under /app/data, and the previously used huggingface-cache named volume is removed from the compose volumes definition.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A cache directory now has its home,
No volumes needed, just paths to roam,
Environment variables light the way,
Hugging Face models can stay and play!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: fixing HF cache permissions and adding a startup fallback directory creation mechanism in both backend/app.py and docker-compose.yml.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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