Skip to content

Commit

Permalink
feat: Increase Context Size for GPT Models.
Browse files Browse the repository at this point in the history
  • Loading branch information
zurawiki committed Jun 16, 2023
1 parent 3fd32bb commit 508d717
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tiktoken-rs/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ macro_rules! starts_with_any {
/// This function does not panic. It returns a default value of 4096 if the model is not recognized.
pub fn get_context_size(model: &str) -> usize {
if starts_with_any!(model, "gpt-4-32k") {
return 32768;
return 32_768;
}
if starts_with_any!(model, "gpt-4") {
return 8192;
}
if starts_with_any!(model, "gpt-3.5-turbo-16k") {
return 16_384;
}
if starts_with_any!(model, "gpt-3.5-turbo") {
return 4096;
}
Expand Down

0 comments on commit 508d717

Please sign in to comment.