|
Download SPACE_DEPLOYMENT.md from akhaliq/Lance: direct link, hf CLI and curl.
- Browser
- Download file 3.29 kB
-
https://huggingface.co/spaces/akhaliq/Lance/resolve/main/SPACE_DEPLOYMENT.md
- Command line
-
hf download hf://spaces/akhaliq/Lance/SPACE_DEPLOYMENT.md
-
curl -L -o SPACE_DEPLOYMENT.md https://huggingface.co/spaces/akhaliq/Lance/resolve/main/SPACE_DEPLOYMENT.md
3.29 kB
A newer version of the Gradio SDK is available: 6.29.1
Hugging Face Space Deployment
This repository is prepared for a Gradio-based Hugging Face Space with ZeroGPU.
Runtime
- Space SDK: Gradio
- Space hardware: ZeroGPU
- Space Python: 3.10.13
- Public port:
7860 - Entrypoint:
python app.py - Recommended use: ZeroGPU for request-scoped GPU allocation
- In the Space settings UI, select
ZeroGPUas the hardware target
Model Assets
The app first checks local model files under LANCE_MODEL_BASE_DIR.
Default behavior:
- Local checkout with
downloads/: use./downloads - Hugging Face Space without local assets: download from
bytedance-research/Lanceinto/data/lance_models - Video tasks use the pre-fetched
Lance_3B_Videoassets when available. - Startup prefetch downloads the model snapshots on CPU so the first GPU request does not pay that cold-start cost.
- RIFE interpolation is optional. The app now falls back to the original video if the RIFE script or checkpoint is missing or incompatible. To restore interpolation, keep the RIFE code and
RIFE/train_log/flownet.pklfrom the same release. - Image tasks unload the active video model first, then load
Lance_3B. - Switching back to a video task unloads
Lance_3B, then reloadsLance_3B_Video.
Useful environment variables:
LANCE_MODEL_REPO_ID: Hugging Face model repo to download from. Default:bytedance-research/LanceLANCE_MODEL_BASE_DIR: directory containingLance_3B_Video,Qwen2.5-VL-ViT, andWan2.2_VAE.pthLANCE_VIDEO_MODEL_PATH: explicit video model directory overrideLANCE_IMAGE_MODEL_PATH: explicit image model directory overrideLANCE_MODEL_PATH: legacy explicit model directory override used for both task families if the family-specific override is unsetLANCE_MODEL_VARIANT:videoorimage; default isvideoLANCE_AUTO_DOWNLOAD: set to1to download missing assets from the HubLANCE_GPUS: comma-separated GPU IDs, for example0or0,1LANCE_QUEUE_SIZE: Gradio queue sizeLANCE_GRADIO_TMP_ROOT: output and temporary file directoryLANCE_ZEROGPU_MAX_DURATION_SECONDS: upper bound for the task-aware@spaces.GPUduration request in seconds (default cap: 300)LANCE_INSTALL_FLASH_ATTN_ON_STARTUP: set to1to install the pinned flash-attn wheel during Space startup instead of inside the GPU reservation (the wheel matches Python 3.10.13 and torch 2.8.0)LANCE_PREFETCH_MODEL_ASSETS: set to0to skip CPU-side model prefetch at startupLANCE_PREFETCH_MODEL_VARIANTS: comma-separated model variants to prefetch, for examplevideo,image
Expected model layout:
${LANCE_MODEL_BASE_DIR}/
Lance_3B_Video/
llm_config.json
model.safetensors
tokenizer.json
...
Lance_3B/
llm_config.json
model.safetensors
tokenizer.json
...
Qwen2.5-VL-ViT/
config.json
vit.safetensors
Wan2.2_VAE.pth
Local Docker Check
docker build -t lance-space .
docker run --gpus all -p 7860:7860 \
-e LANCE_MODEL_BASE_DIR=/models/lance \
-v /path/to/lance/downloads:/models/lance \
lance-space
Open http://localhost:7860.
Files Not Uploaded
The Space build excludes generated or heavyweight local files through .dockerignore:
downloads/results/tmps/- Python cache files