소스 검색

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

jmorganca 2 달 전
부모
커밋
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"
+			)
 		}
 	}