slandl/Agents_Course_Final_Assignment
0
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
Running Locally
- Install Poetry if you haven't already:
pip install poetry- Install dependencies:
poetry install- Authenticate with Hugging Face:
- Option 1: Run
poetry run huggingface-cli login - Option 2: Set the
HF_TOKENenvironment variable with your access token
- Start the application:
python app.pyThe app will be available at http://localhost:7860 by default.
LLM Backend Configuration
By default, the application uses a Hugging Face LLM backend. You can configure which backend to use with environment variables:
Hugging Face Backend (Default)
No additional configuration needed beyond the Hugging Face authentication mentioned above.
OpenAI Backend
To use OpenAI backend:
Set the environment variables:
export MODEL_TYPE=openai
export OPENAI_MODEL=gpt-4o-mini # or your preferred model
export OPENAI_KEY=your_openai_api_key
export OPENAI_TEMPERATURE=0.15
# Optional: Rate limiting configuration
export OPENAI_MAX_RETRIES=10 # Default: 10 (increased from LlamaIndex default of 3)
export OPENAI_TIMEOUT=120.0 # Default: 120.0 seconds (increased from default 60.0)Ollama Backend
To use an Ollama backend instead:
Set the environment variable:
export MODEL_TYPE=ollama
export OLLAMA_MODEL=your_model_name
export OLLAMA_TEMPERATURE=0.15
export OLLAMA_CONTEXT_WINDOW=4000Required Agent Capabilities
- [x] Websearch
- [x] Rate limit handling (OpenAI API with exponential backoff)
- [x] Audio understanding/transcription
- [x] Providing a concise answer
- [ ] Web Video Viewing (Browser)
- [x] Image understanding
- [x] Attached file understanding (Excel)
Unset env vars
unset MODEL_TYPE; unset HF_TOKEN; unset HF_MODEL; unset HF_TEMPERATURE; unset OLLAMA_MODEL; unset OLLAMA_TEMPERATURE; unset OLLAMA_CONTEXT_WINDOW; unset OPENAI_MODEL; unset OPENAI_KEY; unset OPENAI_TEMPERATURE; unset OPENAI_MAX_RETRIES; unset OPENAI_TIMEOUT