Spaces:
Sleeping
Sleeping
Add deployment instructions
Browse files
DEPLOY.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# π Quick Deployment Instructions
|
| 2 |
+
|
| 3 |
+
## β
Repository Status
|
| 4 |
+
|
| 5 |
+
**SimpleHF is now synced with Hugging Face Space!**
|
| 6 |
+
|
| 7 |
+
Repository: https://huggingface.co/spaces/gladguy/SimpleProject
|
| 8 |
+
Branch: main
|
| 9 |
+
Latest commit: 119408d - "Add AnatomyBot - MBBS Anatomy Tutor with AI-powered learning features"
|
| 10 |
+
|
| 11 |
+
## π€ Push to Hugging Face
|
| 12 |
+
|
| 13 |
+
Run this command to deploy:
|
| 14 |
+
|
| 15 |
+
```bash
|
| 16 |
+
git push origin main
|
| 17 |
+
```
|
| 18 |
+
|
| 19 |
+
If you need authentication, use your Hugging Face credentials:
|
| 20 |
+
- Username: `gladguy` (or your username)
|
| 21 |
+
- Password: Your Hugging Face access token (get from https://huggingface.co/settings/tokens)
|
| 22 |
+
|
| 23 |
+
## π Configure API Keys (CRITICAL!)
|
| 24 |
+
|
| 25 |
+
After pushing, you MUST add these secrets in your Space settings:
|
| 26 |
+
|
| 27 |
+
1. Go to: https://huggingface.co/spaces/gladguy/SimpleProject/settings
|
| 28 |
+
2. Scroll to **Repository secrets**
|
| 29 |
+
3. Add:
|
| 30 |
+
- Name: `SERPAPI_KEY` β Value: Your SERPAPI key
|
| 31 |
+
- Name: `HYPERBOLIC_API_KEY` β Value: Your Hyperbolic key
|
| 32 |
+
|
| 33 |
+
## β¨ What's Included
|
| 34 |
+
|
| 35 |
+
β
`app.py` - Main AnatomyBot application with:
|
| 36 |
+
- Anatomy-only question validation
|
| 37 |
+
- Google Images search via SERPAPI
|
| 38 |
+
- AI content generation via Hyperbolic (Llama 3.3 70B)
|
| 39 |
+
- Interactive Gradio interface
|
| 40 |
+
|
| 41 |
+
β
`requirements.txt` - All Python dependencies
|
| 42 |
+
|
| 43 |
+
β
`README.md` - Space description with Hugging Face configuration
|
| 44 |
+
|
| 45 |
+
β
`setup.py` - Helper script to configure API keys locally
|
| 46 |
+
|
| 47 |
+
β
`.gitignore` - Prevents committing .env and other sensitive files
|
| 48 |
+
|
| 49 |
+
## π― After Deployment
|
| 50 |
+
|
| 51 |
+
Your Space will be live at:
|
| 52 |
+
**https://huggingface.co/spaces/gladguy/SimpleProject**
|
| 53 |
+
|
| 54 |
+
Test with these questions:
|
| 55 |
+
- "Show me the Circle of Willis"
|
| 56 |
+
- "Brachial plexus anatomy"
|
| 57 |
+
- "Carpal bones arrangement"
|
| 58 |
+
|
| 59 |
+
## π Local Testing (Before Pushing)
|
| 60 |
+
|
| 61 |
+
To test locally first:
|
| 62 |
+
|
| 63 |
+
1. Configure your API keys:
|
| 64 |
+
```bash
|
| 65 |
+
python setup.py
|
| 66 |
+
# OR manually edit .env file
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
2. Run the app:
|
| 70 |
+
```bash
|
| 71 |
+
python app.py
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
3. Open http://localhost:7860 in your browser
|
| 75 |
+
|
| 76 |
+
## π§ Troubleshooting
|
| 77 |
+
|
| 78 |
+
**Issue: Authentication failed when pushing**
|
| 79 |
+
```bash
|
| 80 |
+
# Use access token in URL
|
| 81 |
+
git remote set-url origin https://gladguy:YOUR_TOKEN@huggingface.co/spaces/gladguy/SimpleProject
|
| 82 |
+
git push origin main
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
**Issue: Space shows error after deployment**
|
| 86 |
+
- Check that both API keys are set in Space secrets
|
| 87 |
+
- Check the build logs in the Space
|
| 88 |
+
|
| 89 |
+
## π Files Ready to Deploy
|
| 90 |
+
|
| 91 |
+
```
|
| 92 |
+
SimpleHF/
|
| 93 |
+
βββ .gitignore β
Committed
|
| 94 |
+
βββ README.md β
Committed (with HF config)
|
| 95 |
+
βββ app.py β
Committed
|
| 96 |
+
βββ requirements.txt β
Committed
|
| 97 |
+
βββ setup.py β
Committed
|
| 98 |
+
βββ .env β Not committed (contains secrets)
|
| 99 |
+
```
|
| 100 |
+
|
| 101 |
+
## π Ready to Deploy!
|
| 102 |
+
|
| 103 |
+
Everything is committed and ready. Just run:
|
| 104 |
+
|
| 105 |
+
```bash
|
| 106 |
+
git push origin main
|
| 107 |
+
```
|
| 108 |
+
|
| 109 |
+
Then configure your API keys in the Space settings!
|