[PR #10447] convert/convert_qwen2: Fix ropescaling factor data type for Qwen2 models #13244

Open
opened 2026-04-13 00:21:54 -05:00 by GiteaMirror · 0 comments
Owner

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

State: open
Merged: No


The data type used for rope scaling factor, ropeFactor, is defined in convert_phi3.go as an array of type float32, but ropescaling factor is supposed to be a single float32 (short_factor and long_factor are lists of float32). This fix modifies the data type of the ropescaling factor in the qwen2Model struct to be a float32, which matches what it is in other model specific convert files.

Without this fix, the following error is shown when trying to convert qwen2 based models that have the ropescaling factor in the config.json file. (Such as the openhands models)

Error: json: cannot unmarshal number into Go struct field .rope_scaling.factor of type convert.ropeFactor

**Original Pull Request:** https://github.com/ollama/ollama/pull/10447 **State:** open **Merged:** No --- The data type used for rope scaling factor, `ropeFactor`, is defined in [convert_phi3.go](https://github.com/ollama/ollama/blob/5cfc1c39f3d5822b0c0906f863f6df45c141c33b/convert/convert_phi3.go#L118) as an array of type `float32`, but ropescaling `factor` is supposed to be a single `float32` (`short_factor` and `long_factor` are lists of `float32`). This fix modifies the data type of the ropescaling factor in the `qwen2Model` struct to be a `float32`, which matches what it is in other model specific convert files. Without this fix, the following error is shown when trying to convert qwen2 based models that have the ropescaling factor in the config.json file. (Such as the openhands models) `Error: json: cannot unmarshal number into Go struct field .rope_scaling.factor of type convert.ropeFactor`
GiteaMirror added the pull-request label 2026-04-13 00:21:54 -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#13244