This guide explains how to deploy the Drying Assistant application to Hugging Face Spaces.
- A Hugging Face account (sign up at huggingface.co)
- Your OpenRouter API key
- Your Stability AI API key
- Go to huggingface.co/spaces
- Click "Create new Space"
- Fill in the following details:
- Owner: Your username
- Space name: drying-assistant (or any name you prefer)
- License: MIT
- SDK: Gradio
- Space hardware: CPU (Free)
- Make sure "Public" is selected
You have two options:
- Click on "Files" in your new Space
- Upload all the files from your local repository
- Clone your Space repository:
git clone https://huggingface.co/spaces/YOUR_USERNAME/drying-assistant
- Copy your project files to the cloned repository
- Commit and push the changes:
git add . git commit -m "Initial commit" git push
To protect your API keys, set them as environment variables in your Space:
- Go to your Space settings
- Click on "Repository secrets"
- Add the following secrets:
- OPENROUTER_API_KEY: Your OpenRouter API key
- STABILITY_API_KEY: Your Stability AI API key
- Wait for the build to complete (this may take a few minutes)
- Once deployed, your app will be available at:
https://huggingface.co/spaces/YOUR_USERNAME/drying-assistant
If you encounter any issues:
- Check the build logs in your Space
- Verify that your environment variables are correctly set
- Ensure all dependencies are properly listed in requirements.txt
Gradio also offers its own hosting service:
- Install the Gradio CLI:
pip install gradio
- Deploy your app:
gradio deploy
Render is another good option for deploying Gradio apps:
- Create a new Web Service on Render
- Connect your GitHub repository
- Set the build command:
pip install -r requirements.txt - Set the start command:
python app.py - Add your environment variables in the Render dashboard
Remember to never commit your API keys to the repository. Always use environment variables or secrets management for sensitive information.