Spaces:
Running on Zero
A newer version of the Gradio SDK is available: 6.22.0
Deploying to Hugging Face Spaces
A note on hardware / ZeroGPU
This app is CPU-only by design β all local ML (intent classifier, anomaly detector, TF-IDF retrieval) runs on scikit-learn, and the LLM call goes to the remote HF Inference API rather than running locally.
If your account only offers the ZeroGPU hardware tier (some free/new
accounts can't select CPU-basic for new Spaces), that's fine: app.py
includes a small @spaces.GPU-decorated health-check function purely so
the platform's ZeroGPU compatibility check passes at startup. It's never
called on the actual request path, so it adds no latency or GPU cost β
you can safely select ZeroGPU hardware when creating the Space.
Two ways to deploy: the web UI (easiest, no git needed) or the CLI/git route.
Option A β Web UI upload (fastest)
- Go to https://huggingface.co/new-space
- Fill in:
- Space name: e.g.
daifuku-warehouse-ai - License: MIT (or your choice)
- Select the Space SDK: Gradio
- Space hardware: CPU basic (free tier is enough for this app)
- Visibility: Public (so you can share the link with Daifuku)
- Space name: e.g.
- Click Create Space.
- On the new Space page, click Files β Add file β Upload files, and
upload the entire project folder contents (keep the folder structure:
app.py,requirements.txt,README.md,src/,models/,data/,assets/). Drag-and-drop the whole folder works in most browsers. - Wait for the Space to build (check the Logs tab if it fails β almost always a missing/incompatible package version).
- Once it shows "Running", your demo is live at:
https://huggingface.co/spaces/<your-username>/daifuku-warehouse-ai
Option B β git (recommended if you'll keep iterating)
# 1. Install the CLI and log in (needs a token with "write" scope)
pip install huggingface_hub
huggingface-cli login
# 2. Create the Space (or create it via the web UI first, then just clone it)
huggingface-cli repo create daifuku-warehouse-ai --type space --space_sdk gradio
# 3. Clone it, copy in the project files, and push
git clone https://huggingface.co/spaces/<your-username>/daifuku-warehouse-ai
cd daifuku-warehouse-ai
cp -r /path/to/this/project/* .
git add .
git commit -m "Initial commit: Smart Warehouse AI Assistant"
git push
The Space will automatically build from requirements.txt and launch
app.py (as declared in the README's YAML front matter: sdk: gradio,
app_file: app.py).
Enabling the LLM (recommended before sharing with Daifuku)
By default the Space runs in retrieval-only fallback mode β it still works, but answers are extractive rather than LLM-generated. To turn on real LLM responses:
- Create an access token at https://huggingface.co/settings/tokens (a "Read" token is sufficient for Inference API calls).
- In your Space, go to Settings β Variables and secrets β New secret.
- Name:
HF_TOKEN - Value: your token
- Name:
- (Optional) Add another secret/variable
LLM_MODEL_IDif you want a different hosted model than the defaultQwen/Qwen2.5-7B-Instruct(any chat-capable model available via HF Inference Providers works). - Restart the Space (Settings β Factory reboot, or just wait β it picks up new secrets on the next restart).
Re-training / updating the models
The Space loads pre-built artifacts from models/ and data/ β it
does not retrain on startup, so boot time stays fast. If you change
src/data_generation.py, src/intent_model.py, or src/anomaly_model.py,
regenerate everything locally before pushing:
python build_artifacts.py
git add models/ data/ assets/
git commit -m "Retrain models"
git push
Sharing with Daifuku
Once it's live, share the Space URL directly:
https://huggingface.co/spaces/<your-username>/daifuku-warehouse-ai
Consider also linking the Model Evaluation tab specifically in your application/cover letter, since it's the clearest evidence of rigorous, reproducible ML work rather than just a UI demo.