Fix Darwin 35B load: CPU offload flag + spaces pkg + persistent cache

#6

Fixes three issues blocking the Space from running inference:

  1. Added spaces to requirements.txt β€” required for @spaces.GPU decorator on ZeroGPU hardware; missing spaces package causes import failures.

  2. Added llm_int8_enable_fp32_cpu_offload=True to BitsAndBytesConfig β€” the 35B MoE model triggers Accelerate's memory estimator to suggest CPU spilling for some layers. Without this flag, BnB raises ValueError: Some modules are dispatched on the CPU...

  3. Set HF_HOME and HF_HUB_CACHE to /data/ β€” so the 67GB model weights persist across ZeroGPU cold-starts on the mounted bucket storage.

  4. Added max_memory={0: "22GiB", "cpu": "200GiB"} β€” calms the MoE memory estimator on A10G 24GB so it doesn't unnecessarily suggest CPU dispatch.

  5. Increased @spaces.GPU duration to 600s β€” 67GB download + load on first cold-start needs more than 300s.

specimba changed pull request status to open
specimba changed pull request status to merged

Sign up or log in to comment