Skip to content

Import upstream sampling correctness fix - #1

Merged
CamzCodex merged 1 commit into
hardening/phase-1-correctnessfrom
import/upstream-pr-262-sampling
Jul 21, 2026
Merged

Import upstream sampling correctness fix#1
CamzCodex merged 1 commit into
hardening/phase-1-correctnessfrom
import/upstream-pr-262-sampling

Conversation

@CamzCodex

Copy link
Copy Markdown
Owner

Imports shiyu-coder#262 into the hardening branch. This preserves the original contributor commit and fixes combined top-k/top-p filtering plus optional sampling arguments.

- Remove early return in top_k_top_p_filtering that caused top-p to be
  ignored when top-k was enabled
- Fix None guard in sample_from_logits to avoid TypeError when only one
  of top_k/top_p is provided
- Normalize None args to defaults before calling filter function
@CamzCodex
CamzCodex merged commit 75e9f51 into hardening/phase-1-correctness Jul 21, 2026
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.

2 participants