# 🚀 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 ``` --- ## 💡 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** 🎓