• Stefy Lanza (nextime / spora )'s avatar
    let the model loader authenticate to the Hub, like the diarization worker always has · 46b4988e
    Stefy Lanza (nextime / spora ) authored
    The diarization worker resolved an HF token from the environment or a protected
    file in the config dir, and gated pyannote repos worked. The MODEL LOADING path
    had no such resolution: the host runner forwards HF_TOKEN from the host
    environment, which is only set if whoever launched the container exported it,
    and on this install it was not -- so huggingface_hub went out unauthenticated
    for every from_pretrained.
    
    That is invisible until a repo is gated, and then it fails as 401 "must be
    authenticated", which reads exactly like terms that have not been accepted even
    when they have. On stabilityai/stable-audio-open-1.0 the account had access and
    the token on disk could fetch the weights with curl, while the engine loading
    them could not -- so the obvious reading was a licence problem, and it was a
    credentials-plumbing problem.
    
    The resolution moves into codai/hf_cache.py, which already owns how a process
    talks to the Hub, and is applied from the same entry point as the cache
    settings: both have to be in place before huggingface_hub is imported, and an
    install that configured one has configured the other in the same directory. The
    file/env list is kept identical to the worker's, and the worker now calls it,
    because two answers to "where is the token" is how one path authenticates and
    another does not. Its per-request override still wins. Never logged: it ends up
    in request headers, and a test holds that.
    
    Also torchsde, which Stable Audio Open's CosineDPMSolverMultistepScheduler is
    built on. diffusers imports it lazily, so without it the model downloads its
    3.8 GB in full and only then fails at request time, after the wait.
    Co-Authored-By: 's avatarClaude Opus 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_014T3rZozi1Ehk96NG1WesgC
    46b4988e
test_hf_token_resolution.py 6.26 KB