Spaces:
Sleeping
π Hugging Face Spaces Deployment Checklist
β Pre-Deployment Checklist
1. File Structure
-
app.py- Main Streamlit application (entry point) -
download_images.py- Image downloading utilities -
photos_url.csv- Image dataset (25,000+ URLs) -
requirements.txt- Python dependencies -
README.md- Project documentation -
.gitignore- Clean repository
2. File Names (Critical for Hugging Face)
- Main app file:
app.py(entry point at repo root) - Dependencies:
requirements.txt - Documentation:
README.md(contains HF Spaces metadata header)
3. Code Verification
- App imports successfully
- Dependencies are correctly specified
- No syntax errors
- Proper error handling
π― Hugging Face Spaces Setup
Step 1: Create New Space
- Go to Hugging Face Spaces
- Click "Create new Space"
- Choose your repository
- Select SDK:
Streamlitβ (CRITICAL) - Select License: Choose appropriate license
- Click "Create Space"
Step 2: Upload Files
Include at minimum:
app.py(main application)photos_url.csv(dataset of image URLs)requirements.txt(dependencies)README.md(metadata + documentation)- Optional:
download_images.py(standalone utility)
Note: For Streamlit Spaces you do not need a custom Dockerfile; the platform runs app.py based on the README metadata.
Step 3: Configure Secrets (Optional for Text Search)
If you want text search powered by openai/clip-vit-base-patch32 via the Inference API:
- Go to Space β Settings β Secrets
- Add secret key:
HF_TOKENwith your Hugging Face token value - Save
Step 4: Verify Deployment
- Check that the Space shows "Building" status
- Wait for build to complete (usually 2-5 minutes)
- Verify the app loads without "No application file found" error
- Test the interface functionality
π§ Troubleshooting Common Issues
Issue: "No application file found"
Solution: Ensure app.py is the main file (not start_app.py)
Issue: Build fails
Solution: Ensure app.py and requirements.txt exist at repo root and the README has the metadata header
Issue: App loads but text search is disabled
Solution: Add HF_TOKEN secret to the Space. Image upload search works without it.
Issue: Images not downloading
Solution: Verify photos_url.csv is present and accessible
π Post-Deployment Verification
1. App Loading
- App loads without errors
- No "No application file found" message
- Streamlit interface appears
2. Functionality
- Search by ID works
- Range by Block works
- Images display correctly
- No Python errors in console
3. Performance
- App responds within reasonable time
- Image downloads work (if needed)
- No memory issues
π Success Indicators
β
App loads successfully
β
No "No application file found" error
β
Streamlit interface appears
β
Search functionality works
β
Images display correctly
β
No Python errors in logs
π If Issues Persist
- Check Space logs in Hugging Face interface
- Verify file names match exactly
- Ensure Streamlit SDK is selected
- Check requirements.txt format
- Verify app.py is the main entry point
Your app should now deploy successfully on Hugging Face Spaces! π