my-gradio-app / run.sh
Nguyen Trong Lap
Recreate history without binary blobs
eeb0f9c
raw
history blame contribute delete
575 Bytes
#!/usr/bin/env bash
set -e
# Try to activate venv if it exists
if [ -f "venv/bin/activate" ]; then
# shellcheck source=/dev/null
source venv/bin/activate
fi
# Warn if API key not set
if [ -z "$OPENAI_API_KEY" ]; then
echo "Warning: OPENAI_API_KEY is not set. Export it before running for production."
echo "Example: export OPENAI_API_KEY=\"sk-...\""
fi
# Default entrypoint: app.py (required)
if [ -f "app.py" ]; then
gradio app.py
else
echo "Error: app.py not found. The default entrypoint is app.py. Create app.py or run manually."
exit 1
fi