Skip to content

Conversation

@mattt
Copy link
Owner

@mattt mattt commented Dec 10, 2025

Related to #51

This fixes the crash observed when running unit tests.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug in the greedy sampling mode implementation within LlamaLanguageModel. The greedy sampler was missing the required llama_sampler_init_greedy() call in its sampler chain, which is now properly added. The test suite is also refactored to use a simpler model initialization pattern.

Key changes:

  • Added missing llama_sampler_init_greedy() call to complete the greedy sampling chain
  • Simplified test model initialization from computed property to direct constant
  • Removed redundant customTemperature() test

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Sources/AnyLanguageModel/Models/LlamaLanguageModel.swift Adds the missing llama_sampler_init_greedy() call to properly initialize greedy sampling mode
Tests/AnyLanguageModelTests/LlamaLanguageModelTests.swift Simplifies model initialization and removes redundant test case

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mattt mattt merged commit f75aca4 into main Dec 10, 2025
9 checks passed
@mattt mattt deleted the mattt/llama-fix-invalid-sampler branch December 10, 2025 12:54
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