Hard code max token counts for supported models (#9675)

This commit is contained in:
Nathan Sobo
2024-03-21 20:30:33 -06:00
committed by GitHub
parent 441677c90a
commit 6d5787cfdc
3 changed files with 19 additions and 7 deletions
+2 -7
View File
@@ -97,13 +97,8 @@ impl LanguageModel {
pub fn max_token_count(&self) -> usize {
match self {
LanguageModel::OpenAi(model) => tiktoken_rs::model::get_context_size(model.id()),
LanguageModel::ZedDotDev(model) => match model {
ZedDotDevModel::GptThreePointFiveTurbo
| ZedDotDevModel::GptFour
| ZedDotDevModel::GptFourTurbo => tiktoken_rs::model::get_context_size(model.id()),
ZedDotDevModel::Custom(_) => 30720, // TODO: Base this on the selected model.
},
LanguageModel::OpenAi(model) => model.max_token_count(),
LanguageModel::ZedDotDev(model) => model.max_token_count(),
}
}