Spaces:
Runtime error
Runtime error
Saravanakumar R commited on
Commit Β·
a4dc1e4
1
Parent(s): b016462
fix: add HF Spaces README frontmatter
Browse files
README.md
CHANGED
|
@@ -1,2 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# G.U.I.D.E.
|
| 2 |
G.U.I.D.E. - Grievance Utility for Information extraction, Drafting and Enrichment
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: G.U.I.D.E.
|
| 3 |
+
emoji: π
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: indigo
|
| 6 |
+
sdk: docker
|
| 7 |
+
pinned: false
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
# G.U.I.D.E.
|
| 11 |
G.U.I.D.E. - Grievance Utility for Information extraction, Drafting and Enrichment
|
| 12 |
+
|
| 13 |
+
## Deploying to Hugging Face Spaces
|
| 14 |
+
|
| 15 |
+
### 1. Upload model weights to HF Model Hub (one-time)
|
| 16 |
+
|
| 17 |
+
```bash
|
| 18 |
+
huggingface-cli login
|
| 19 |
+
python scripts/upload_models_to_hub.py --repo-id <your-username>/guide-models
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
This uploads only inference-needed files (`config.json`, `model.safetensors`, `tokenizer*.json`, `model.pt`). Training checkpoints are excluded automatically.
|
| 23 |
+
|
| 24 |
+
### 2. Create a Dockerfile Space on HF
|
| 25 |
+
|
| 26 |
+
Create a new Space at huggingface.co/spaces with **Dockerfile** as the Space SDK.
|
| 27 |
+
|
| 28 |
+
### 3. Push the code
|
| 29 |
+
|
| 30 |
+
```bash
|
| 31 |
+
git remote add hf https://huggingface.co/spaces/<your-username>/guide
|
| 32 |
+
git push hf main
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
### 4. Set the build argument
|
| 36 |
+
|
| 37 |
+
In the Space **Settings β Build**, set:
|
| 38 |
+
```
|
| 39 |
+
HF_MODEL_REPO=<your-username>/guide-models
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
### 5. Set the API key secret
|
| 43 |
+
|
| 44 |
+
In the Space **Settings β Secrets**, add:
|
| 45 |
+
```
|
| 46 |
+
ANTHROPIC_API_KEY=sk-ant-...
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
The key is injected at runtime β it is never baked into the Docker image.
|
| 50 |
+
|
| 51 |
+
### Architecture note
|
| 52 |
+
|
| 53 |
+
The Space runs two processes inside one container:
|
| 54 |
+
- **FastAPI** on `:8000` β internal only, not publicly exposed
|
| 55 |
+
- **Gradio** on `:7860` β the public-facing UI served by HF Spaces
|
| 56 |
+
|
| 57 |
+
The Gradio frontend calls `http://localhost:8000` internally; no ports other than 7860 need to be open.
|