Cant download BSC-LT/salamandra-7b-instruct

Hello! I have used Salamndra for training aLLM model recently, but since two weeks ago it doesnt go past this point:

/workspace/.local/lib/python3.11/site-packages/transformers/utils/hub.py:127: FutureWarning: Using `TRANSFORMERS_CACHE` is deprecated and will be removed in v5 of Transformers. Use `HF_HOME` instead.
warnings.warn(

tokenizer_config.json:

1.61k/? [00:00<00:00, 195kB/s]

tokenizer.model: 0%

0.00/4.81M [00:00<?, ?B/s]

Any suggestions?

Thank u, Ivan

1 Like

The error symptoms seem typical of issues related to hf_xet, but if it’s not a new error, pip install -U huggingface_hub hf_xet often fixes it.


What’s going on, in plain terms

  • tokenizer_config.json (very small, non-Xet file) downloads fine.

  • The download then stops on tokenizer.model (4.81 MB, Xet-backed file in this repo). (Hugging Face)

  • That pattern (small files OK, Xet files stuck at 0%) is typical of issues with:

    • hf_xet (the Rust client used for Xet storage), or
    • network / firewall / DNS toward Xet endpoints, or
    • a corrupted cache entry for that file.

The Salamandra repo itself is fine and widely used in tools like LitGPT, Ollama wrappers, etc., so this is almost certainly not a Salamandra-specific bug. (Hugging Face)

The TRANSFORMERS_CACHE deprecation warning is just informational, not the root cause. (Hugging Face)


Cause 1: hf_xet / Xet backend issues

Background

  • Salamandra’s large files and tokenizer assets (tokenizer.model, tokenizer.json, safetensors shards) are stored via Xet. (Hugging Face)
  • Newer huggingface_hub uses hf_xet automatically for Xet-backed files if the package is installed. (Hugging Face)
  • There are multiple recent issues and forum posts where downloads of Xet-backed files hang at 0% due to hf_xet bugs or old versions. (GitHub)

What to do

  1. Disable Xet in this environment (safest first step):

    # Shell
    export HF_HUB_DISABLE_XET=1  # see env var docs: https://huggingface.co/docs/huggingface_hub/en/package_reference/environment_variables
    

    Or at the very top of your Python script, before imports:

    import os
    os.environ["HF_HUB_DISABLE_XET"] = "1"
    
    from transformers import AutoTokenizer, AutoModelForCausalLM
    tok = AutoTokenizer.from_pretrained("BSC-LT/salamandra-7b-instruct")
    

    This tells huggingface_hub to avoid Xet entirely and use regular HTTP downloads instead. (Hugging Face)

  2. Uninstall hf-xet if problems persist:

    pip uninstall -y hf-xet xet
    

    There is a known issue where older hf-xet versions (for example 1.0.0) pass “available” checks but then fail at runtime, causing hangs. (GitHub)


Cause 2: Network / VPN / firewall blocking Xet endpoints

Background

  • Xet uses extra domains like cas-bridge.xethub.hf.co, cas-server.xethub.hf.co, etc. (GitHub)
  • On some VPNs or corporate networks, these domains don’t resolve or are blocked, so Xet downloads never start (progress bar stays at 0%). Similar “stuck at 0% forever” reports exist for large HF downloads behind VPN/firewalls. (GitHub)

What to do

  • If you control the network:

    • Allow-list at least:

      • huggingface.co, hf.co
      • cdn-lfs.hf.co and regional variants
      • cas-bridge.xethub.hf.co, cas-server.xethub.hf.co, transfer.xethub.hf.co (GitHub)
  • If you do not control the network:

    • Keep HF_HUB_DISABLE_XET=1 so Xet is not used.
    • As a fallback, download the model from a different network/machine and copy the snapshot to your training environment.

Cause 3: Corrupted cache entry for Salamandra

Background

  • HF caches files under ~/.cache/huggingface/hub by default. (Hugging Face)
  • If a previous tokenizer.model download was interrupted, you can have a zero-byte or partial file that confuses retries.

What to do

  1. Delete only Salamandra from the cache:

    Using the CLI: (Hugging Face)

    pip install -U "huggingface_hub[cli]"
    hf cache delete --pattern "BSC-LT/salamandra-7b-instruct"
    

    Or manually:

    rm -rf ~/.cache/huggingface/hub/models--BSC-LT--salamandra-7b-instruct
    
  2. Retry the download, ideally with HF_HUB_DISABLE_XET=1 already set so you don’t hit the same path again.


Cause 4: Version combo (hub / transformers / hf_xet)

Background

  • There are versions where HF_HUB_DISABLE_XET is buggy (e.g. huggingface_hub 0.34.1 in one reported issue), or where progress bars are misleading. (GitHub)

What to do

  • Keep things reasonably up to date:

    pip install -U "huggingface_hub[cli]" transformers
    
  • If a specific version is known-bad in an issue, pin to a known-good version (e.g. 0.33.x) until a fix is released. (GitHub)


Robust workaround: download once, then use local files

Even if Xet/network is flaky, you can separate “download once” from “train many times”.

  1. Download a full snapshot to a folder:

    import os
    os.environ["HF_HUB_DISABLE_XET"] = "1"
    
    from huggingface_hub import snapshot_download  # see docs: https://huggingface.co/docs/huggingface_hub/en/guides/download
    
    local_dir = "./salamandra-7b-instruct"
    snapshot_download("BSC-LT/salamandra-7b-instruct",
                      local_dir=local_dir,
                      local_dir_use_symlinks=False)
    
  2. Load from that folder only, no network:

    from transformers import AutoTokenizer, AutoModelForCausalLM
    
    model_path = "./salamandra-7b-instruct"
    tok = AutoTokenizer.from_pretrained(model_path, local_files_only=True)
    model = AutoModelForCausalLM.from_pretrained(model_path, local_files_only=True)
    

This avoids repeated Hub calls during training and makes your setup more deterministic. (Hugging Face)


Very short checklist

  1. Set HF_HUB_DISABLE_XET=1.
  2. Uninstall hf-xet if still stuck.
  3. Clear Salamandra’s cache (hf cache delete --pattern "BSC-LT/salamandra-7b-instruct").
  4. Ensure huggingface_hub / transformers are up to date.
  5. If the network is restrictive, consider downloading once elsewhere and loading from local files only.

Wow, thanks for your reply!

1 Like

Just to let you know, disabling xet worked! Thx

1 Like