| title | Template Final Assignment |
|---|---|
| emoji | 🕵🏻♂️ |
| colorFrom | indigo |
| colorTo | indigo |
| sdk | gradio |
| sdk_version | 5.25.2 |
| app_file | app.py |
| pinned | false |
| hf_oauth | true |
| hf_oauth_expiration_minutes | 480 |
This template provides a foundation for building AI agents with various tools and capabilities.
This project uses uv for fast and reliable Python package management.
- Install uv:
# On macOS and Linux curl -LsSf https://astral.sh/uv/install.sh | sh # On Windows powershell -c "irm https://astral.sh/uv/install.ps1 | iex" # With pip (if you have Python already) pip install uv
-
Clone the repository:
git clone <your-repo-url> cd Final_Assignment_Template
-
Create and activate a virtual environment with dependencies:
uv sync
-
Activate the virtual environment:
# The virtual environment is automatically managed by uv # To run commands in the environment, use: uv run python app.py
# Run the main application
uv run python app.py
# Run with specific Python interpreter
uv run --python 3.12 python app.py# Quick start with Docker Compose
cp .env.docker .env # Configure your API keys
docker-compose up -d
# Access at http://localhost:7860See DOCKER.md for complete Docker documentation.
# Add a new dependency
uv add package-name
# Add a development dependency
uv add --dev package-name
# Remove a dependency
uv remove package-nameCreate a .env file in the project root with your API keys:
OPENAI_API_KEY=your_openai_api_key_here
TAVILY_API_KEY=your_tavily_api_key_here
SPACE_ID=your_space_id_hereIf you prefer to use pip, the original requirements.txt file is still available:
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run the application
python app.py| Task | uv | pip |
|---|---|---|
| Installation | curl -LsSf https://astral.sh/uv/install.sh | sh |
Comes with Python |
| Create environment | uv sync (automatic) |
python -m venv venv && source venv/bin/activate |
| Install dependencies | uv sync |
pip install -r requirements.txt |
| Add dependency | uv add package-name |
pip install package-name && pip freeze > requirements.txt |
| Run script | uv run python app.py |
python app.py (after activation) |
| Lock dependencies | uv.lock (automatic) |
pip freeze > requirements.txt |
| Speed | ⚡ Very fast | 🐌 Slower |
| Reproducibility | 🔒 Built-in lockfile | 📝 Manual freeze required |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference