Some fixes for gemma2 (#99)

* some fixes for gemma2

* format

* fixes

* format
This commit is contained in:
Awni Hannun
2024-08-01 20:06:11 -07:00
committed by GitHub
parent ac6bdfccec
commit 885e520ecd
5 changed files with 326 additions and 110 deletions

View File

@@ -168,7 +168,7 @@ extension ModelConfiguration {
defaultPrompt: "what is the difference between lettuce and cabbage?"
) { prompt in
"<start_of_turn>user \(prompt)<end_of_turn><start_of_turn>model"
"<start_of_turn>user\n\(prompt)<end_of_turn>\n<start_of_turn>model\n"
}
public static let gemma_2_9b_it_4bit = ModelConfiguration(
@@ -178,6 +178,17 @@ extension ModelConfiguration {
// https://www.promptingguide.ai/models/gemma
defaultPrompt: "What is the difference between lettuce and cabbage?"
) { prompt in
"<start_of_turn>user\n\(prompt)<end_of_turn>\n<start_of_turn>model\n"
}
public static let gemma_2_2b_it_4bit = ModelConfiguration(
id: "mlx-community/gemma-2-2b-it-4bit",
overrideTokenizer: "PreTrainedTokenizer",
// https://www.promptingguide.ai/models/gemma
defaultPrompt: "What is the difference between lettuce and cabbage?"
) { prompt in
"<start_of_turn>user \(prompt)<end_of_turn><start_of_turn>model"
}