convert-hf : use zero value of sliding_window to distinguish Phi-4 from other PHI3 models
This commit is contained in:
parent
520e8a0377
commit
c7fdbd3735
1 changed files with 5 additions and 3 deletions
|
@ -2254,8 +2254,10 @@ class Phi3MiniModel(Model):
|
||||||
self.gguf_writer.add_rope_dimension_count(rope_dims)
|
self.gguf_writer.add_rope_dimension_count(rope_dims)
|
||||||
self.gguf_writer.add_rope_freq_base(self.find_hparam(["rope_theta"]))
|
self.gguf_writer.add_rope_freq_base(self.find_hparam(["rope_theta"]))
|
||||||
self.gguf_writer.add_file_type(self.ftype)
|
self.gguf_writer.add_file_type(self.ftype)
|
||||||
# handle null value of sliding_window (Phi-4 model)
|
sliding_window = self.hparams.get("sliding_window")
|
||||||
if (sliding_window := self.hparams.get("sliding_window")) is not None:
|
# use zero value of sliding_window to distinguish Phi-4 from other PHI3 models
|
||||||
|
if sliding_window is None:
|
||||||
|
sliding_window = 0
|
||||||
self.gguf_writer.add_sliding_window(sliding_window)
|
self.gguf_writer.add_sliding_window(sliding_window)
|
||||||
|
|
||||||
def generate_extra_tensors(self) -> Iterable[tuple[str, Tensor]]:
|
def generate_extra_tensors(self) -> Iterable[tuple[str, Tensor]]:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue