Skip to content

feat: add hf_token to config for Hugging Face authentication#35

Merged
ChanyaVRC merged 2 commits into
masterfrom
feat/hf-token
May 4, 2026
Merged

feat: add hf_token to config for Hugging Face authentication#35
ChanyaVRC merged 2 commits into
masterfrom
feat/hf-token

Conversation

@ChanyaVRC

Copy link
Copy Markdown
Owner

Summary

  • hf_token フィールドを Config に追加。config.json または環境変数 HF_TOKEN で設定可能
  • ボット起動時に hf_token が設定されていれば HF_TOKEN 環境変数に反映し、transformers / sentence-transformers / huggingface_hub がすべて自動的に認証を使用する
  • 未設定時(空文字)は既存の動作と変わらない

設定例

{
  // ... 他の設定 ...
  "hf_token": "hf_xxxxxxxxxxxxxxxxxxxx"
}

または環境変数:

HF_TOKEN=hf_xxxxxxxxxxxxxxxxxxxx

Test plan

  • 194 tests pass

ChanyaVRC added 2 commits May 4, 2026 15:29
Setting hf_token in config.json (or HF_TOKEN env var) applies the token
as HF_TOKEN environment variable before models are loaded, enabling
access to gated models on the Hugging Face Hub.
@ChanyaVRC ChanyaVRC merged commit b3b065e into master May 4, 2026
2 checks passed
@ChanyaVRC ChanyaVRC deleted the feat/hf-token branch May 4, 2026 06:51
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