ai-toolkit icon indicating copy to clipboard operation
ai-toolkit copied to clipboard

Models are not downloading.

Open blackcement opened this issue 7 months ago • 11 comments

Can anyone tell me what the problem is? The models are not downloading, you can wait forever.

Image

blackcement avatar Apr 26 '26 23:04 blackcement

Image Same here. These downloads are hidden behind a box, and it won't download directly.

peterbenjamin225 avatar Apr 28 '26 16:04 peterbenjamin225

Image Same here. These downloads are hidden behind a box, and it won't download directly.

@peterbenjamin225 Have you solved the problem? Apparently you had to wait longer, the download progress is not displayed

blackcement avatar Apr 30 '26 01:04 blackcement

Weirdly, for me, ai-toolkit showed nothing while dlownloading the model as above, but it did do the download.

jgrasty avatar May 09 '26 00:05 jgrasty

Yes, there is still a problem: the model starts downloading, but then it may simply stop without any errors. You can wait all night and nothing happens. Meanwhile, the network activity on the computer drops to zero. You have to restart the process, and it starts downloading from the very beginning. This needs to be fixed — sometimes you have to make up to 20 attempts for the download to complete successfully.

blackcement avatar May 24 '26 19:05 blackcement

this seems still to be a problem. it happens or me as well.

sacredbone avatar Jun 23 '26 08:06 sacredbone

Yes, facing the same issue the model download is stuck.

Not moving beyond this point

flux-2-klein-base-9b.safetensors: 11%|#1 | 2.08G/18.2G [00:20<00:38, 417MB/s]

prerana-1601 avatar Jun 27 '26 01:06 prerana-1601

I figure that unless you have a super-fast and stable internet connected via cable instead of Wi-Fi, you should never allow automatic download. I wasted hundreds gigabyte of metered bandwidth when download stuck halfway. It cannot resume partial download; it always redownloads the whole things again. It also downloads mysterious blob files in the cache instead of the actual files, so I cannot back it up or move it around.

Best practice for us internet peasant is to download them manually, then just point to it in the training setting. The problem is I cannot be sure what models are actually needed, so I usually download the whole huggingface repo, wasting further bandwidth. Also, not all required models are in the repo, for example I download the krea/Krea-2-Turbo repo manually, but I'm still stuck when the program fail to completely download the 8GB Qwen/Qwen3-VL-4B-Instruct that it need.

nakanakapoi avatar Jun 30 '26 10:06 nakanakapoi

I figure that unless you have a super-fast and stable internet connected via cable instead of Wi-Fi, you should never allow automatic download. I wasted hundreds gigabyte of metered bandwidth when download stuck halfway. It cannot resume partial download; it always redownloads the whole things again. It also downloads mysterious blob files in the cache instead of the actual files, so I cannot back it up or move it around.

Best practice for us internet peasant is to download them manually, then just point to it in the training setting. The problem is I cannot be sure what models are actually needed, so I usually download the whole huggingface repo, wasting further bandwidth. Also, not all required models are in the repo, for example I download the krea/Krea-2-Turbo repo manually, but I'm still stuck when the program fail to completely download the 8GB Qwen/Qwen3-VL-4B-Instruct that it need.

can you please tell me how do you download like krea Krea-2-Raw files and how to place it ? maybe a very fast qucik video or pictures and u would be jesus chris for most of us

hamid1372 avatar Jul 04 '26 23:07 hamid1372

can you please tell me how do you download like krea Krea-2-Raw files and how to place it ? maybe a very fast qucik video or pictures and u would be jesus chris for most of us

For Krea-2-Raw I download all the files from the repo one by one then organize them within Krea-2-Raw folder, the same folder structure as in the repo. The whole repo is 58 GB total. If you have stable internet, you can use Hugging Face CLI tool which can download them all in one go but I use download manager like Jdownloader so that it can resume partial download.

Then in training setting, put the folder path in the "Name or Path" field, like "C:\Model\Krea-2-Raw". However, the program will still download a several GB of other model not in the repo during the first run so be ready for that.

nakanakapoi avatar Jul 04 '26 23:07 nakanakapoi

Workaround for stalled/frozen downloads on large model repos (e.g. Krea-2-Raw, ~62GB)

Hit repeated stalls and full freezes trying to download krea/Krea-2-Raw — Xet transfers would either crash with File reconstruction error: Internal Writer Error: Background writer channel closed, or silently freeze at 0 Kbps mid-download with no error at all. Here's what got me through it, on Windows with a 740Mbps connection. Should apply regardless of whether you're using venv, conda, or the installer scripts, and on any drive/path.

1. Activate whatever Python environment ai-toolkit is using

# venv
.\venv\Scripts\activate

# or conda
conda activate your-env-name

2. Make sure hf_xet is up to date, and set these env vars in that same terminal

pip install -U hf_xet

$env:HF_XET_HIGH_PERFORMANCE = "1"
$env:HF_XET_RECONSTRUCT_WRITE_SEQUENTIALLY = "1"
$env:HF_HUB_DOWNLOAD_TIMEOUT = "60"

cmd.exe equivalent: set HF_XET_HIGH_PERFORMANCE=1 etc.

3. Log in

Unauthenticated requests get throttled/deprioritized — noticeably worse without this.

hf auth login

4. Download the repo directly, outside of ai-toolkit's job runner

Pick any local folder you want — it doesn't need to be inside the ai-toolkit directory.

hf download krea/Krea-2-Raw --local-dir "D:\models\Krea-2-Raw"

Swap D:\models\Krea-2-Raw for wherever you want it. Linux/Mac users, same command, just a normal path like ~/models/Krea-2-Raw.

5. When it stalls (it likely will, at least once)

Sometimes Ctrl+C won't even respond if Xet's background writer thread hangs. If that happens, open a new terminal window and force-kill it:

Get-Process | Where-Object {$_.ProcessName -like "*python*" -or $_.ProcessName -like "*hf*"}
Stop-Process -Id <PID> -Force

Linux/Mac:

ps aux | grep -E "python|hf"
kill -9 <PID>

Then just re-run the exact same hf download command in the same shell type you started with. Don't switch between HF_HUB_DISABLE_XET=1 and Xet enabled between attempts — mixing partial-download formats breaks resume and causes genuine restarts from 0.

Important: resume happens per-file, not per-repo. You'll see the progress bar reset to a smaller number (like 0%|292M/8.88G) which looks like it's starting the whole thing over — it's not, it's just showing progress on the next incomplete file in the 55-file set. To check real total progress across the whole download:

Get-ChildItem "D:\models\Krea-2-Raw" -Recurse -File | Measure-Object -Property Length -Sum | Select-Object @{Name="SizeGB";Expression={$_.Sum / 1GB}}

Linux/Mac:

du -sh /path/to/models/Krea-2-Raw

6. Once fully downloaded, verify integrity before training

hf cache verify krea/Krea-2-Raw --local-dir "D:\models\Krea-2-Raw"

7. Point your config at the local folder instead of the repo ID

model:
  name_or_path: "D:\\models\\Krea-2-Raw"   # Windows — double backslashes
  # name_or_path: "/home/you/models/Krea-2-Raw"   # Linux/Mac

If you're using the web UI rather than editing YAML directly, just paste the local folder path into the Name or Path field under the Model section.

Key takeaways

  • Stick to one terminal type (cmd or PowerShell, or your shell of choice on Linux/Mac) for the whole download — don't switch mid-way.
  • Don't toggle Xet on/off between attempts.
  • Being authenticated noticeably helped both speed and stability.
  • Downloading outside ai-toolkit's own job process (rather than watching it fail mid-training-job) made stalls much easier to diagnose and recover from.
  • Even after fully downloading locally, expect ai-toolkit to still pull a few more GB of auxiliary files on first training run (shared VAE/text encoder not included in the main repo) — that's normal.

Took several stall/kill/resume cycles but got there in the end — hope this saves someone the afternoon it cost me.

aadityamundhalia avatar Jul 08 '26 12:07 aadityamundhalia

Downloads still fail. Download a bit and then just hangs.

How a bout a simple fix.

Spit out the exact hf command and let me download it my self in a Linux terminal because it has no problems there. Show the proper command in the "Progress" window.

Thanks.

JDJoe avatar Nov 07 '26 14:11 JDJoe