Skip to content

Support HuggingFace completion prompts for non-Llama models#266

Open
mitre88 wants to merge 1 commit into
web-arena-x:mainfrom
mitre88:codex/huggingface-completion-prompts
Open

Support HuggingFace completion prompts for non-Llama models#266
mitre88 wants to merge 1 commit into
web-arena-x:mainfrom
mitre88:codex/huggingface-completion-prompts

Conversation

@mitre88

@mitre88 mitre88 commented May 23, 2026

Copy link
Copy Markdown

Summary

  • Add a generic HuggingFace completion prompt path so non-Llama generation endpoints can construct prompts instead of failing in prompt construction.
  • Replace the previous KeyError('model_tag') path with an actionable error for unsupported HuggingFace chat mode.
  • Add focused tests covering non-Llama completion prompts and the non-Llama chat error message.

Why

Issue #221 reports an unhandled KeyError('model_tag') when trying to evaluate a HuggingFace model such as microsoft/phi-2. The prompt constructor referenced a missing model_tag config key before it could give a useful error or allow a completion-mode prompt.

Validation

  • REDDIT=http://reddit.local SHOPPING=http://shopping.local SHOPPING_ADMIN=http://shopping-admin.local GITLAB=http://gitlab.local WIKIPEDIA=http://wikipedia.local MAP=http://map.local HOMEPAGE=http://homepage.local uv run --python 3.11 --with pytest==7.1.2 --with pytest-asyncio --with gymnasium --with playwright==1.32.1 --with beartype==0.12.0 --with tiktoken --with transformers==4.33.2 --with openai==0.27.0 --with aiolimiter --with nltk --with text-generation --with Pillow python -m pytest tests/test_prompt_constructor.py -q
  • git diff --check

Note: I used Python 3.11 for local validation on Apple Silicon because Playwright 1.32.1 depends on greenlet 2.0.1, whose Python 3.10 macOS wheel is x86_64-only and failed to build locally on arm64.

/claim https://algora.io/PrimeIntellect-ai/bounties/U3xSkpanaVo8u1sT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant