[PR #11318] Fix 6932 empty suffix fim #13505

Open
opened 2026-04-13 00:29:02 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/ollama/ollama/pull/11318

State: open
Merged: No


Community Note

  • Please vote on this pull request by adding a 👍 reaction to help prioritize it.
  • Please do not leave "+1" or similar comments to reduce noise.
  • Verified with go test -v -run '^TestGenerateWithEmptySuffix$'.

Affected Endpoint

  • /api/generate

Description

Fixes issue #6932, where the /api/generate endpoint for the qwen2.5-coder:1.5b model fails to exhibit Fill-in-the-Middle (FIM) behavior when suffix is an empty string (""), unlike when it’s a space (" "). This PR modifies the server to treat an empty suffix as a space to trigger FIM, aligning with expected behavior for this model.

Changes

  • Updated server.go (or equivalent) to handle an empty suffix by setting it to a space for qwen2.5-coder:1.5b, ensuring FIM functionality.
  • Added TestGenerateWithEmptySuffix in server_test.go to verify the fix, using a local test server to simulate the API.
**Original Pull Request:** https://github.com/ollama/ollama/pull/11318 **State:** open **Merged:** No --- **Community Note** * Please vote on this pull request by adding a 👍 reaction to help prioritize it. * Please do not leave "+1" or similar comments to reduce noise. * Verified with `go test -v -run '^TestGenerateWithEmptySuffix$'`. **Affected Endpoint** * /api/generate **Description** Fixes issue #6932, where the `/api/generate` endpoint for the `qwen2.5-coder:1.5b` model fails to exhibit Fill-in-the-Middle (FIM) behavior when `suffix` is an empty string (`""`), unlike when it’s a space (`" "`). This PR modifies the server to treat an empty `suffix` as a space to trigger FIM, aligning with expected behavior for this model. **Changes** - Updated `server.go` (or equivalent) to handle an empty `suffix` by setting it to a space for `qwen2.5-coder:1.5b`, ensuring FIM functionality. - Added `TestGenerateWithEmptySuffix` in `server_test.go` to verify the fix, using a local test server to simulate the API.
GiteaMirror added the pull-request label 2026-04-13 00:29:02 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#13505