浏览代码

add trailing \n\n after <end_of_image> to match reference implementation

jmorganca 1 月之前
父节点
当前提交
11bfa62796
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      model/models/gemma3/model.go

+ 4 - 2
model/models/gemma3/model.go

@@ -133,8 +133,10 @@ func (m *Model) PostTokenize(ctx ml.Context, inputs []input.Input) ([]input.Inpu
 				result = append(result, input.Input{Multimodal: imageToken, MultimodalHash: fnvHash.Sum64()})
 			}
 
-			// <end_of_image>
-			result = append(result, input.Input{Token: 256000})
+			result = append(result,
+				input.Input{Token: 256000}, // <end_of_image>
+				input.Input{Token: 108},    // "\n\n"
+			)
 		}
 	}