CoolFace
Apppublic

Natsumix/final-assignment-agent

sourceHugging Faceupdated 1mo agoView on Hugging Face
0likes
App README

Final Assignment Agent

This public, Static Hugging Face Space is the project page for my Hugging Face Agents Course final assignment. The runnable agent lives in agent.py and is deliberately executed outside the Space (for example, in Google Colab or a local Python environment).

What it does

The agent uses `smolagents`, web search, and one model call per task to research a task. With Gemini, it also downloads and processes attached images, audio, PDFs, Python files, and Excel workbooks. It returns only the requested final answer, a format suited to the final benchmark's exact-match evaluation. The one-call design fits low daily API quotas.

If the course's /files/{task_id} route returns 404, attachment downloads fall back to an immutable revision of the public bstraehle/gaia Space containing the same five GAIA evaluation files.

Run externally

bash
pip install -r requirements.txt
export HF_TOKEN="your_hugging_face_token"
python agent.py "Research the main ideas behind the ReAct agent pattern."

Optional configuration:

bash
export HF_MODEL_ID="Qwen/Qwen2.5-Coder-32B-Instruct"
python agent.py "Your task here"

By default, Hugging Face selects a compatible Inference Provider automatically. Set HF_PROVIDER only if you deliberately want a specific provider.

Evaluate and submit

To generate answers for the 20 course questions without changing the leaderboard:

bash
python agent.py --evaluate --output answers.json

With the Gemini free-tier limit of 5 requests/minute, this run intentionally pauses for 15 seconds between questions. It needs 20 Gemini requests in total and takes about five minutes.

Review answers.json, then submit explicitly:

bash
python agent.py --evaluate --submit --username Natsumix

The --submit switch is deliberately required, so fetching questions and testing the agent never submits a score by accident.

HF_TOKEN is read only from the execution environment. Do not commit tokens, notebooks with tokens, or .env files to this public repository.

Gemini (recommended)

If a Gemini API key is present, the agent automatically uses Gemini instead of Hugging Face Inference Providers:

bash
export GEMINI_API_KEY="your_gemini_api_key"
export GEMINI_MODEL="gemini-3.1-flash-lite"  # optional; this is the default
python agent.py "Your task here"

The key exists only in the execution environment and is never stored in this public Space.

Files

  • index.html — static project page served by this Space.
  • agent.py — command-line agent for Colab or local execution.
  • requirements.txt — external runtime dependencies.

License

MIT