algorithm-research-deck / DEPLOYMENT.md
zhiyi
Use DeepSeek V4 Flash with bilingual query planning
a42007f
|
Raw History Blame Contribute Delete
2.29 kB
# Deploy to wingsxyp/algorithm-research-deck
Target Space: `https://huggingface.co/spaces/wingsxyp/algorithm-research-deck`
## Token roles
- **Write token**: use only on your computer for Git authentication and pushing files to the Space repository.
- **Inference token**: add to the Space as the Secret `HF_TOKEN`. It needs permission to call Hugging Face Inference Providers, but does not need repository write access.
- Never commit either token. Never put the write token in Space Secrets.
## Space settings
The repository README configures a Gradio Space. DeepSeek-V4-Flash is called through Hugging Face Inference Providers because its 284B total parameters are too large for direct loading in one ZeroGPU allocation. The Space can remain on ZeroGPU, although the application itself does not request ZeroGPU for model inference.
Add this Secret:
```text
HF_TOKEN=<your fine-grained inference token>
```
Add these Variables:
```text
HF_MODEL_ID=deepseek-ai/DeepSeek-V4-Flash
HF_PROVIDER=auto
CONTACT_EMAIL=<your email for polite arXiv requests>
```
The model must be public or accessible to the account that owns the read token. A gated model requires accepting its terms with the same account.
## Local authentication and push
From the project root:
```powershell
git init
git add .
git commit -m "Deploy ZeroGPU algorithm research deck"
git branch -M main
git remote add origin https://huggingface.co/spaces/wingsxyp/algorithm-research-deck
git push -u origin main
```
When Git asks for credentials:
```text
Username: wingsxyp
Password: <your write token>
```
The password field does not display typed characters. This is expected.
## Verify
Open the Space build logs. A successful build installs Gradio, Spaces, Transformers, PyTorch dependencies, and launches `app.py`. Test `Retrieval-Augmented Generation` in Quick mode first.
Verify:
- arXiv search completes
- DeepSeek-V4-Flash responds through an Inference Provider
- the presentation appears in the right panel
- HTML, JSON, and ZIP downloads work
- the downloaded HTML opens independently in a browser
If inference fails, first confirm `HF_MODEL_ID`, the token's Inference Providers permission, provider availability, and account credits. Do not replace the inference token with the repository write token.