| # π 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) |
|
|
| 1. Go to https://huggingface.co/join |
| 2. Sign up (free!) |
| 3. Verify your email |
|
|
| ### Step 2: Create a New Space |
|
|
| 1. Go to https://huggingface.co/new-space |
| 2. Fill in: |
| - **Owner**: Your username |
| - **Space name**: `ppt-script-generator` |
| - **License**: MIT |
| - **Select SDK**: Choose **Gradio** |
| - **Space hardware**: CPU basic (free) |
| - **Visibility**: Public |
| 3. Click **"Create Space"** |
|
|
| ### Step 3: Upload Your Files |
|
|
| You need to upload 3 files: |
|
|
| 1. **Click "Files and versions"** tab |
| 2. **Click "Add file" β "Upload files"** |
| 3. **Upload these 3 files:** |
|
|
| π **File 1: `app.py`** |
| - Upload the `app.py` file from this package |
|
|
| π **File 2: `requirements.txt`** |
| - Upload `requirements_hf.txt` |
| - **IMPORTANT**: Rename it to `requirements.txt` when uploading |
|
|
| π **File 3: `README.md`** |
| - Upload `README_HF.md` |
| - **IMPORTANT**: Rename it to `README.md` when uploading |
|
|
| 4. **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 |
|
|
| 1. **Enter a topic**: e.g., "The Future of Renewable Energy" |
| 2. **Set number of slides**: e.g., 5 |
| 3. **Choose audience**: e.g., "Business executives" |
| 4. **Select tone**: e.g., "Professional" |
| 5. **Click "Generate Presentation Script"** |
| 6. **Wait 10-30 seconds** for AI to generate |
| 7. **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 |
|
|
| 1. Go to your Space page |
| 2. Click "Analytics" tab |
| 3. See: |
| - Total users |
| - Active users |
| - Usage patterns |
|
|
| ### Check Logs |
|
|
| 1. Click "Logs" tab |
| 2. See real-time output |
| 3. 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 |
|
|
| ```html |
| <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: |
|
|
| 1. **Be Specific**: |
| - β
"The Impact of AI on Healthcare Diagnostics" |
| - β "AI stuff" |
|
|
| 2. **Choose Right Audience**: |
| - Match to who will actually listen |
| - Affects language complexity |
|
|
| 3. **Appropriate Tone**: |
| - Professional for business |
| - Educational for students |
| - Technical for engineers |
|
|
| 4. **Optimal Slides**: |
| - 3-7 slides work best |
| - More slides = slower generation |
|
|
| 5. **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 instructions |
| - `test_hf_app.py` - Test script for local verification |
| - `app.py` - Main application code |
| - `README_HF.md` - Space description |
|
|
| --- |
|
|
| ## β¨ You're Done! |
|
|
| **Congratulations!** π |
|
|
| Your AI-powered PowerPoint Script Generator is now live on HuggingFace Spaces! |
|
|
| **Next steps:** |
| 1. Test it with different topics |
| 2. Share the URL with friends/colleagues |
| 3. Add to your portfolio |
| 4. 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** π |
|
|