| title | app_file | sdk | sdk_version |
|---|---|---|---|
HolidayPostsGenerator |
app.py |
gradio |
5.31.0 |
A LinkedIn post generator for Ag-Tech companies using holiday data. This application uses OpenAI's GPT models to generate engaging "did you know?" style posts based on holiday information.
Here's how the application looks when deployed on Hugging Face Spaces:
The chatbot interface allows users to:
- Ask for posts for specific dates
- Receive 3 different LinkedIn post ideas tailored for Ag-Tech companies
- Get posts with relevant hashtags and engaging content
- Choose their favorite post from the generated options
- Python 3.9 or higher
- OpenAI API Key - Get one from OpenAI Platform
- uv (recommended) or pip for package management
-
Install uv (if not already installed):
curl -LsSf https://astral.sh/uv/install.sh | sh -
Clone and setup:
git clone <your-repo-url> cd HolidayPostsGenerator uv venv uv sync
-
Set up your OpenAI API key:
export OPENAI_API_KEY="your-api-key-here"
Or create a
.envfile:echo "OPENAI_API_KEY=your-api-key-here" > .env
-
Run the application:
uv run python run.py
-
Clone and setup:
git clone <your-repo-url> cd HolidayPostsGenerator python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
-
Set up your OpenAI API key (same as above)
-
Run the application:
python run.py
-
Create a new Space on Hugging Face Spaces
-
Choose Gradio SDK when creating the space
-
Upload your files to the space:
app.pypyproject.tomluv.lock(orrequirements.txt)resources/folder (withHolidaysDB.tsv)README.md
-
Set environment variables in your Space settings:
- Go to Settings → Variables and secrets
- Add
OPENAI_API_KEYwith your API key
-
Your app will automatically deploy! The Gradio interface will be available at your space URL.
The app can be deployed to any platform that supports Python web applications:
- Railway: Connect your GitHub repo
- Render: Deploy as a web service
- Heroku: Use the included
pyproject.toml - Docker: Create a Dockerfile (see example below)
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 7860
CMD ["python", "run.py"]Once running, the application will:
- Start a Gradio web interface (usually at
http://localhost:7860) - Allow you to chat with the LinkedIn post generator
- Generate holiday-themed posts for your Ag-Tech company
The uv.lock file ensures all dependencies are locked to specific versions for reproducible builds.
- Interactive chat interface for generating LinkedIn posts
- Holiday database integration
- OpenAI GPT-4 integration for content generation
- Professional and engaging post suggestions
"OpenAI API key not found" error:
- Make sure you've set the
OPENAI_API_KEYenvironment variable - Check that your API key is valid and has credits
- Restart the application after setting the environment variable
"Module not found" errors:
- Make sure you've installed all dependencies:
uv syncorpip install -r requirements.txt - Check that you're in the correct virtual environment
App won't start:
- Ensure Python 3.9+ is installed
- Check that port 7860 is available (or Gradio will find another port)
- Look at the console output for specific error messages
Hugging Face deployment issues:
- Make sure all required files are uploaded to your Space
- Check that the
OPENAI_API_KEYis set in Space settings - Verify the Space is using the correct Python version (3.9+)
- gradio: Web interface framework
- openai: OpenAI API client
- pandas: Data manipulation
- pypdf: PDF processing
- python-dotenv: Environment variable management
HolidayPostsGenerator/
├── app.py # Main application code
├── run.py # Simple runner script
├── pyproject.toml # Project configuration
├── uv.lock # Locked dependencies (uv)
├── requirements.txt # Dependencies (pip)
├── README.md # This file
└── resources/
├── HolidaysDB.tsv # Holiday database
└── Chat_Screenshot.png # Interface preview
