Skip to content

Fix repetition penalty forwarding in data generation - #82

Draft
Sehlani042 wants to merge 1 commit into
deepseek-ai:mainfrom
Sehlani042:agent/fix-generation-repetition-penalty
Draft

Fix repetition penalty forwarding in data generation#82
Sehlani042 wants to merge 1 commit into
deepseek-ai:mainfrom
Sehlani042:agent/fix-generation-repetition-penalty

Conversation

@Sehlani042

Copy link
Copy Markdown

Summary

  • forward --repetition-penalty through SGLang's extra_body
  • keep it distinct from OpenAI presence_penalty
  • reject non-positive repetition penalty values
  • add focused regression coverage

Root cause

generate_train_data.py mapped the CLI repetition penalty to presence_penalty. These are different sampling controls: SGLang exposes repetition_penalty as an extra request field, while presence_penalty changes token-presence behavior. The CLI therefore silently requested a different sampling policy than the user selected.

Validation

  • deterministic regression tests failed before the fix and pass with this patch
  • env PYTHONPATH=. uv run --with pytest --with openai pytest -q tests/test_generate_train_data.py (3 passed)
  • uvx ruff check tests/test_generate_train_data.py
  • uvx ruff check --ignore BLE001 scripts/data/generate_train_data.py tests/test_generate_train_data.py (the unignored source-file scan reports three pre-existing BLE001 findings outside this diff)
  • python -m py_compile for both changed Python files
  • git diff --check origin/main...HEAD

AI assistance

This change was developed with Codex assistance. I reviewed the diff and validation evidence before publication.

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