A newer version of the Gradio SDK is available: 6.10.0
π Quick Start: Deploy to HuggingFace Spaces in 5 Minutes
What You're Deploying
A PowerPoint Script Generator that uses AI to create presentation scripts for any topic.
No installation required! Everything runs in the cloud on HuggingFace Spaces.
β‘ Super Fast Deployment (3 Steps)
Step 1: Create a HuggingFace Account (if needed)
- Go to https://huggingface.co/join
- Sign up (free!)
- Verify your email
Step 2: Create a New Space
- Go to https://huggingface.co/new-space
- Fill in:
- Owner: Your username
- Space name:
ppt-script-generator - License: MIT
- Select SDK: Choose Gradio
- Space hardware: CPU basic (free)
- Visibility: Public
- Click "Create Space"
Step 3: Upload Your Files
You need to upload 3 files:
Click "Files and versions" tab
Click "Add file" β "Upload files"
Upload these 3 files:
π File 1:
app.py- Upload the
app.pyfile from this package
π File 2:
requirements.txt- Upload
requirements_hf.txt - IMPORTANT: Rename it to
requirements.txtwhen uploading
π File 3:
README.md- Upload
README_HF.md - IMPORTANT: Rename it to
README.mdwhen uploading
- Upload the
Click "Commit changes to main"
Step 4: Wait for Build
- HuggingFace automatically builds your Space (takes 1-2 minutes)
- You'll see a progress indicator
- When complete, you'll see "App" tab become active
Step 5: Use Your App!
- Click the "App" tab
- Your app is now live!
- Share the URL:
https://huggingface.co/spaces/YOUR_USERNAME/ppt-script-generator
π― Using Your App
Try It Out
- Enter a topic: e.g., "The Future of Renewable Energy"
- Set number of slides: e.g., 5
- Choose audience: e.g., "Business executives"
- Select tone: e.g., "Professional"
- Click "Generate Presentation Script"
- Wait 10-30 seconds for AI to generate
- Copy the script and use it!
Example Input/Output
Input:
Topic: Introduction to Artificial Intelligence
Slides: 5
Audience: Students
Tone: Educational
Output: ```
Slide 1: What is Artificial Intelligence?
Speaker Script: Welcome everyone! Today we're diving into the fascinating world of Artificial Intelligence. AI is the science of making computers think and learn like humans do. Imagine teaching a computer to recognize your voice, recommend movies you'll love, or even drive a car - that's all AI!
Key Points:
- AI makes computers intelligent
- Mimics human thinking and learning
- Used in everyday technology
- Growing field with huge potential
Timing: 45 seconds
[... 4 more slides ...]
---
## π File Structure (What You Uploaded)
Your HuggingFace Space: β βββ app.py # Main application βββ requirements.txt # Python dependencies (gradio, huggingface_hub) βββ README.md # Space description (with YAML frontmatter)
---
## β
Verification Checklist
After deployment, verify:
- [ ] Build completed successfully (green checkmark)
- [ ] "App" tab is accessible
- [ ] Example topics load correctly
- [ ] Generate button works
- [ ] Script output appears after 10-30 seconds
- [ ] Copy button works
- [ ] All dropdowns function properly
---
## π Common Issues & Fixes
### Issue 1: Build Failed
**Error**: Red X on build status
**Fix**:
1. Check "Logs" tab for error message
2. Common causes:
- Wrong file names (must be exact: `app.py`, `requirements.txt`, `README.md`)
- Missing YAML frontmatter in README.md
- Syntax error in app.py
### Issue 2: "Sleeping" Message
**Status**: App shows "This Space is sleeping"
**Fix**:
- Normal for free tier after inactivity
- Click anywhere to wake it up
- Takes 10-20 seconds to restart
### Issue 3: Generation Fails
**Error**: "API rate limit exceeded" or timeout
**Fix**:
- Wait 60 seconds and try again
- Reduce number of slides (try 3-5)
- Reduce max tokens (try 1500)
- This is normal during high server load
### Issue 4: Slow Generation
**Status**: Takes > 1 minute to generate
**Fix**:
- Normal for free tier
- HuggingFace API might be busy
- Try off-peak hours
- Consider upgrading to HF Pro for faster inference
---
## π¨ Customization (After Deployment)
Want to change something? Easy!
### Change App Title
1. Click "Files and versions"
2. Click `README.md`
3. Edit the `title:` line in YAML frontmatter
4. Commit changes
5. Space rebuilds automatically
### Change Example Topics
1. Click "Files and versions"
2. Click `app.py`
3. Find the `gr.Examples` section
4. Edit the example list
5. Commit changes
### Adjust Defaults
In `app.py`, find and modify:
```python
num_slides = gr.Slider(
minimum=3,
maximum=10,
value=5, # Change this default
...
)
π Monitor Your Space
View Analytics
- Go to your Space page
- Click "Analytics" tab
- See:
- Total users
- Active users
- Usage patterns
Check Logs
- Click "Logs" tab
- See real-time output
- Debug any issues
π Sharing Your Space
Your Space URL:
https://huggingface.co/spaces/YOUR_USERNAME/ppt-script-generator
Share On:
- Social media (Twitter, LinkedIn)
- Your website or blog
- Email signature
- Portfolio
- GitHub README
Embed in Website
<gradio-app
src="https://huggingface.co/spaces/YOUR_USERNAME/ppt-script-generator">
</gradio-app>
<script
type="module"
src="https://gradio.s3-us-west-2.amazonaws.com/4.44.0/gradio.js">
</script>
π‘ Tips for Success
For Best Results:
Be Specific:
- β "The Impact of AI on Healthcare Diagnostics"
- β "AI stuff"
Choose Right Audience:
- Match to who will actually listen
- Affects language complexity
Appropriate Tone:
- Professional for business
- Educational for students
- Technical for engineers
Optimal Slides:
- 3-7 slides work best
- More slides = slower generation
Review Output:
- Always customize to your style
- Add personal examples
- Practice timing
π What This Demonstrates
This project shows your understanding of:
- β LLM Deployment: Using AI models in production
- β Prompt Engineering: Crafting effective prompts
- β Cloud Infrastructure: Deploying to HuggingFace
- β UI/UX Design: Building user-friendly interfaces
- β API Integration: Using HuggingFace Inference API
- β Real-world Application: Solving actual business problems
Perfect for your Johns Hopkins Agentic AI Certificate portfolio!
π Need Help?
Resources:
- HuggingFace Docs: https://huggingface.co/docs/hub/spaces
- Gradio Guide: https://gradio.app/docs
- Community Forum: https://discuss.huggingface.co
Files Included:
DEPLOYMENT_GUIDE.md- Detailed deployment instructionstest_hf_app.py- Test script for local verificationapp.py- Main application codeREADME_HF.md- Space description
β¨ You're Done!
Congratulations! π
Your AI-powered PowerPoint Script Generator is now live on HuggingFace Spaces!
Next steps:
- Test it with different topics
- Share the URL with friends/colleagues
- Add to your portfolio
- Get feedback and iterate
Your live app:
https://huggingface.co/spaces/YOUR_USERNAME/ppt-script-generator
Time to deploy: < 5 minutes β‘
Cost: $0 (completely free!) π°
Accessibility: Anyone, anywhere π
Built for: Johns Hopkins Agentic AI Program π