Spaces:
Running
Running
Commit History
-
Resolve model paths automatically instead of a runAsContainer flag
The flag was inconsistent in both directions. main.py left it False, so the Space re-downloaded bert-base-uncased and the CLIP processor from the Hub on every boot even though the Dockerfile bakes both into the image — making startup depend on Hub availability and wasting those build steps. Meanwhile CLIPEncoder ignored the flag entirely and hardcoded /models/clip, so captioning could not run outside a container at all. Replace it with model_source(), which prefers the baked copy when the path exists and falls back to the Hub when it does not. Both the Space and local dev now work with no flag to set. Verified locally: the encoder resolves to the Hub and produces a caption identical to the Space's. Also pass args.quantized through in the CLI, which parsed --quantized and then dropped it on the floor. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>ad2704e