Skip to content

Commit

Permalink
Optimise getEncodingForModel
Browse files Browse the repository at this point in the history
The same results are returned withought these 2 if statements
  • Loading branch information
dafriz authored Aug 2, 2024
1 parent 4c98beb commit e8f002d
Showing 1 changed file with 0 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,10 @@ public Optional<Encoding> getEncodingForModel(final String modelName) {
return Optional.of(getEncodingForModel(ModelType.GPT_4O));
}

if (modelName.startsWith(ModelType.GPT_4_32K.getName())) {
return Optional.of(getEncodingForModel(ModelType.GPT_4_32K));
}

if (modelName.startsWith(ModelType.GPT_4.getName())) {
return Optional.of(getEncodingForModel(ModelType.GPT_4));
}

if (modelName.startsWith(ModelType.GPT_3_5_TURBO_16K.getName())) {
return Optional.of(getEncodingForModel(ModelType.GPT_3_5_TURBO_16K));
}

if (modelName.startsWith(ModelType.GPT_3_5_TURBO.getName())) {
return Optional.of(getEncodingForModel(ModelType.GPT_3_5_TURBO));
}
Expand Down

0 comments on commit e8f002d

Please sign in to comment.