Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion convert_hf_to_gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9612,12 +9612,13 @@
self.gguf_writer.add_sliding_window(self.hparams["sliding_window"])
self.gguf_writer.add_expert_feed_forward_length(self.hparams["intermediate_size"])

rope_scaling = self.hparams.get("rope_scaling") or {}
rope_scaling = self.hparams.get("rope_scaling") or (self.hparams.get("rope_parameters" or {}))
rope_type = rope_scaling.get("rope_type", rope_scaling.get("type"))

Check failure on line 9616 in convert_hf_to_gguf.py

View workflow job for this annotation

GitHub Actions / pyright type-check

"get" is not a known attribute of "None" (reportOptionalMemberAccess)

Check failure on line 9616 in convert_hf_to_gguf.py

View workflow job for this annotation

GitHub Actions / pyright type-check

"get" is not a known attribute of "None" (reportOptionalMemberAccess)
assert rope_type == "yarn", f"GPT-OSS only supports yarn rope scaling, got {rope_type}"
self.gguf_writer.add_rope_scaling_type(gguf.RopeScalingType.YARN)
self.gguf_writer.add_rope_scaling_factor(rope_scaling["factor"])

Check failure on line 9619 in convert_hf_to_gguf.py

View workflow job for this annotation

GitHub Actions / pyright type-check

Object of type "None" is not subscriptable (reportOptionalSubscript)
self.gguf_writer.add_rope_freq_base(rope_scaling.get("rope_theta"))

Check failure on line 9620 in convert_hf_to_gguf.py

View workflow job for this annotation

GitHub Actions / pyright type-check

"get" is not a known attribute of "None" (reportOptionalMemberAccess)
self.gguf_writer.add_rope_scaling_orig_ctx_len(rope_scaling.get("original_max_position_embeddings", 4096))

Check failure on line 9621 in convert_hf_to_gguf.py

View workflow job for this annotation

GitHub Actions / pyright type-check

"get" is not a known attribute of "None" (reportOptionalMemberAccess)


@ModelBase.register("Lfm2ForCausalLM", "LFM2ForCausalLM")
Expand Down
Loading