Spaces:
Sleeping
Sleeping
Delete huggingface-deploy-notes.md
Browse files- huggingface-deploy-notes.md +0 -84
huggingface-deploy-notes.md
DELETED
|
@@ -1,84 +0,0 @@
|
|
| 1 |
-
# Hugging Face Spaces Deployment Guide
|
| 2 |
-
|
| 3 |
-
This document provides detailed guidance for deploying CodeBuddy AI on Hugging Face Spaces.
|
| 4 |
-
|
| 5 |
-
## Quick Setup
|
| 6 |
-
|
| 7 |
-
1. Create a new Space on Hugging Face:
|
| 8 |
-
- Choose "Streamlit" as the SDK
|
| 9 |
-
- Set Python 3.10 as the version
|
| 10 |
-
- Link to your GitHub repository or upload files directly
|
| 11 |
-
|
| 12 |
-
2. Add your API key:
|
| 13 |
-
- In Space settings, add a secret named `GOOGLE_API_KEY` with your Gemini API key
|
| 14 |
-
|
| 15 |
-
3. Wait for the build to complete and access your app!
|
| 16 |
-
|
| 17 |
-
## Common Issues & Solutions
|
| 18 |
-
|
| 19 |
-
### Issue: App Shows "Running" But Not Accessible
|
| 20 |
-
|
| 21 |
-
If your app shows as "Running" but you can't access it or only see local URLs:
|
| 22 |
-
|
| 23 |
-
1. **Check Port Configuration**:
|
| 24 |
-
- Hugging Face Spaces uses port 7860 for Streamlit apps
|
| 25 |
-
- Our app has been configured to use this port in multiple places:
|
| 26 |
-
- `.streamlit/config.toml`
|
| 27 |
-
- `Dockerfile`
|
| 28 |
-
- `app.py` startup script
|
| 29 |
-
|
| 30 |
-
2. **Check Server Address Binding**:
|
| 31 |
-
- Streamlit must bind to `0.0.0.0` (all interfaces), not just localhost
|
| 32 |
-
- The `huggingface-space-launcher.py` script ensures this
|
| 33 |
-
|
| 34 |
-
3. **Verify Space Visibility**:
|
| 35 |
-
- Make sure your Space is set to "Public" in the settings
|
| 36 |
-
|
| 37 |
-
### Issue: API Key Not Found
|
| 38 |
-
|
| 39 |
-
If you see an error about missing API key:
|
| 40 |
-
|
| 41 |
-
1. In your Space settings (gear icon), go to "Variables and Secrets"
|
| 42 |
-
2. Add a new secret named `GOOGLE_API_KEY` with your key value
|
| 43 |
-
3. Rebuild your Space (use the "Factory reset" option)
|
| 44 |
-
|
| 45 |
-
### Issue: "streamlit run" Command Not Found
|
| 46 |
-
|
| 47 |
-
If the deployment fails with "command not found":
|
| 48 |
-
|
| 49 |
-
1. Ensure `streamlit` is in the requirements file
|
| 50 |
-
2. Make sure the Spaces SDK is set to "Streamlit"
|
| 51 |
-
3. Try using Python 3.10 explicitly in your Space settings
|
| 52 |
-
|
| 53 |
-
### Issue: Broken UI or Styles Not Loading
|
| 54 |
-
|
| 55 |
-
If the UI appears broken or styles aren't loading:
|
| 56 |
-
|
| 57 |
-
1. Check browser console for errors
|
| 58 |
-
2. Try clearing your browser cache
|
| 59 |
-
3. Verify no CSS conflicts in your Streamlit app
|
| 60 |
-
|
| 61 |
-
## Manual Deployment Verification
|
| 62 |
-
|
| 63 |
-
To verify deployment settings:
|
| 64 |
-
|
| 65 |
-
1. Click on "Logs" in the Space UI
|
| 66 |
-
2. Look for lines containing:
|
| 67 |
-
- Server address (`0.0.0.0`)
|
| 68 |
-
- Port number (should be `7860`)
|
| 69 |
-
- Any error messages about binding or permissions
|
| 70 |
-
|
| 71 |
-
## Advanced: Custom Domain
|
| 72 |
-
|
| 73 |
-
If you want to use a custom domain:
|
| 74 |
-
|
| 75 |
-
1. Go to Space settings
|
| 76 |
-
2. Under "Domain", enter your custom domain
|
| 77 |
-
3. Update your DNS records as instructed
|
| 78 |
-
|
| 79 |
-
## Getting Help
|
| 80 |
-
|
| 81 |
-
If you continue experiencing issues:
|
| 82 |
-
- Check the Hugging Face [Spaces documentation](https://huggingface.co/docs/hub/spaces)
|
| 83 |
-
- Post questions on the Hugging Face [forums](https://discuss.huggingface.co/)
|
| 84 |
-
- Submit issues to the CodeBuddy AI GitHub repository
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|