Ver código fonte

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

jmorganca 1 mês atrás
pai
commit
11bfa62796
1 arquivos alterados com 4 adições e 2 exclusões
  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"
+			)
 		}
 	}