Spaces:
Build error
Hugging Face Spaces Deployment Guide
π Quick Deployment
Step 1: Prepare Your Space
- Go to Hugging Face Spaces
- Click "Create new Space"
- Configure:
- Name:
nsn-integration-dashboard - License: MIT
- SDK: Gradio
- Hardware: CPU Basic (free) or GPU for faster inference
- Name:
Step 2: Upload Files
Upload these files to your Space:
nsn-integration-dashboard/
βββ app.py # Entry point
βββ huggingface_dashboard.py # Main dashboard
βββ backend_telemetry_rank_adapter.py # Module 1
βββ edit_propagation_engine.py # Module 2
βββ rank_feedback_generator.py # Module 3
βββ ensemble_inference_manager.py # Module 4
βββ requirements_dashboard.txt # Dependencies
βββ README.md # Space README (use README_SPACES.md)
Step 3: Configure Space
Create or update README.md in your Space root with the frontmatter from README_SPACES.md:
---
title: NSN Integration Dashboard
emoji: π
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 4.0.0
app_file: app.py
pinned: false
license: mit
---
Step 4: Deploy
- Commit and push files to your Space
- Hugging Face will automatically build and deploy
- Wait 2-3 minutes for build to complete
- Your dashboard will be live at:
https://huggingface.co/spaces/nurcholish/nsn-integration-dashboard
π File Structure
Required Files
app.py (Entry Point)
from huggingface_dashboard import create_gradio_interface
demo = create_gradio_interface()
if __name__ == '__main__':
demo.launch(server_name="0.0.0.0", server_port=7860)
requirements_dashboard.txt (Dependencies)
numpy>=1.21.0
pandas>=1.3.0
gradio>=4.0.0
plotly>=5.14.0
python-dateutil>=2.8.2
Module Files
backend_telemetry_rank_adapter.pyedit_propagation_engine.pyrank_feedback_generator.pyensemble_inference_manager.pyhuggingface_dashboard.py
π¨ Customization
Branding
Edit huggingface_dashboard.py to customize:
with gr.Blocks(title="Your Custom Title", theme=gr.themes.Soft()) as demo:
gr.Markdown("""
# π Your Custom Header
Your custom description
""")
Themes
Available Gradio themes:
gr.themes.Soft()(default)gr.themes.Base()gr.themes.Glass()gr.themes.Monochrome()
Colors
Customize in Space README frontmatter:
colorFrom: blue # Start color
colorTo: purple # End color
π§ Advanced Configuration
Enable GPU
For faster inference, upgrade to GPU hardware:
- Go to Space Settings
- Select "Hardware" tab
- Choose GPU tier (T4, A10G, or A100)
- Confirm upgrade
Add Authentication
Restrict access to your Space:
demo.launch(
auth=("username", "password"),
server_name="0.0.0.0",
server_port=7860
)
Enable Queue
For high traffic:
demo.queue(concurrency_count=3)
demo.launch()
Add Analytics
Track usage with Gradio Analytics:
demo.launch(
analytics_enabled=True,
server_name="0.0.0.0"
)
π Monitoring
View Logs
- Go to your Space page
- Click "Logs" tab
- Monitor real-time activity
Check Status
Space status indicators:
- π’ Running: Space is live
- π‘ Building: Deployment in progress
- π΄ Error: Build failed (check logs)
- βͺ Sleeping: Inactive (will wake on access)
π Troubleshooting
Build Fails
Issue: Dependencies not installing
Solution: Check requirements_dashboard.txt syntax
# Test locally first
pip install -r requirements_dashboard.txt
Import Errors
Issue: Module not found
Solution: Ensure all module files are uploaded and paths are correct
# Use relative imports
from backend_telemetry_rank_adapter import BackendTelemetryRankAdapter
Memory Issues
Issue: Out of memory errors
Solution:
- Upgrade to larger hardware tier
- Reduce batch sizes in visualizations
- Optimize data structures
Slow Performance
Issue: Dashboard is slow
Solution:
- Enable caching:
@gr.cache() - Reduce plot complexity
- Upgrade to GPU hardware
π Updates
Update Your Space
- Edit files locally
- Test changes:
python app.py - Push to Space repository
- Space will auto-rebuild
Version Control
Use Git for version control:
# Clone your Space
git clone https://huggingface.co/spaces/nurcholish/nsn-integration-dashboard
# Make changes
git add .
git commit -m "Update dashboard"
git push
π Sharing
Public Access
Share your Space URL:
https://huggingface.co/spaces/nurcholish/nsn-integration-dashboard
Embed in Website
<iframe
src="https://nurcholish-nsn-integration-dashboard.hf.space"
frameborder="0"
width="100%"
height="800"
></iframe>
API Access
Use Gradio Client:
from gradio_client import Client
client = Client("nurcholish/nsn-integration-dashboard")
result = client.predict("input_data", api_name="/predict")
π Scaling
Handle High Traffic
- Enable Queue:
demo.queue() - Upgrade Hardware: Use GPU or larger CPU
- Optimize Code: Cache results, reduce computations
- Use CDN: For static assets
Multiple Replicas
For enterprise use, contact Hugging Face for:
- Dedicated hardware
- Multiple replicas
- Custom domains
- SLA guarantees
π° Costs
Free Tier
- CPU Basic: Free
- 2 vCPU, 16GB RAM
- Sleeps after 48h inactivity
Paid Tiers
- CPU Upgrade: $0.03/hour
- T4 GPU: $0.60/hour
- A10G GPU: $1.05/hour
- A100 GPU: $3.15/hour
π Resources
π€ Support
Need help?
β Deployment Checklist
- Create Hugging Face account
- Create new Space
- Upload all required files
- Configure README with frontmatter
- Test locally before deploying
- Monitor build logs
- Test all dashboard panels
- Share Space URL
- Add to documentation
- Announce to community
Your NSN Integration Dashboard is now live! π
Share it with the community and start collecting contributions!