Spaces:
Running
Running
Upload SETUP_INSTRUCTIONS.md with huggingface_hub
Browse files- SETUP_INSTRUCTIONS.md +52 -0
SETUP_INSTRUCTIONS.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 🔐 SETUP INSTRUCTIONS FOR HUGGING FACE SPACE
|
| 2 |
+
|
| 3 |
+
## ⚠️ IMPORTANT: Add Your HuggingFace Token
|
| 4 |
+
|
| 5 |
+
The Llama 3.1 model is **gated** and requires authentication.
|
| 6 |
+
|
| 7 |
+
### Steps to Add Token:
|
| 8 |
+
|
| 9 |
+
1. **Get your HuggingFace token:**
|
| 10 |
+
- Go to: https://huggingface.co/settings/tokens
|
| 11 |
+
- Copy your token (starts with `hf_...`)
|
| 12 |
+
|
| 13 |
+
2. **Request access to Llama 3.1:**
|
| 14 |
+
- Go to: https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct
|
| 15 |
+
- Click "Request Access"
|
| 16 |
+
- Wait for approval (usually instant)
|
| 17 |
+
|
| 18 |
+
3. **Add token to Space secrets:**
|
| 19 |
+
- Go to: https://huggingface.co/spaces/sayande/agri-critique/settings
|
| 20 |
+
- Scroll to "Repository secrets"
|
| 21 |
+
- Click "New secret"
|
| 22 |
+
- Name: `HF_TOKEN`
|
| 23 |
+
- Value: `<your token here>`
|
| 24 |
+
- Click "Add"
|
| 25 |
+
|
| 26 |
+
4. **Restart the Space:**
|
| 27 |
+
- The space will automatically rebuild
|
| 28 |
+
- Wait ~2-3 minutes for it to load
|
| 29 |
+
|
| 30 |
+
### ✅ After Setup:
|
| 31 |
+
|
| 32 |
+
Your space will be able to:
|
| 33 |
+
- Load Llama 3.1 8B base model
|
| 34 |
+
- Load your fine-tuned LoRA adapters
|
| 35 |
+
- Run full RAG pipeline
|
| 36 |
+
- Answer questions with evidence
|
| 37 |
+
- Validate answers for errors
|
| 38 |
+
|
| 39 |
+
### 🌐 Your Space:
|
| 40 |
+
https://huggingface.co/spaces/sayande/agri-critique
|
| 41 |
+
|
| 42 |
+
---
|
| 43 |
+
|
| 44 |
+
## 📊 System Overview:
|
| 45 |
+
|
| 46 |
+
**Model:** Llama 3.1 8B + LoRA (sayande/agri-critique-llama)
|
| 47 |
+
**Dataset:** FAISS index (sayande/agri-critique-index)
|
| 48 |
+
**Hardware:** CPU (free) - upgrade to GPU T4 for faster performance
|
| 49 |
+
|
| 50 |
+
**Performance:**
|
| 51 |
+
- CPU: ~30-60s per query
|
| 52 |
+
- GPU T4: ~5-10s per query
|