Revert tokenizer for custom OpenAI models (#17660)
Fix for custom openai models tokenizer settings.
This commit is contained in:
parent
a23e381096
commit
bd1ff476b9
1 changed files with 5 additions and 1 deletions
|
@ -370,7 +370,11 @@ pub fn count_open_ai_tokens(
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
|
if let open_ai::Model::Custom { .. } = model {
|
||||||
|
tiktoken_rs::num_tokens_from_messages("gpt-4", &messages)
|
||||||
|
} else {
|
||||||
tiktoken_rs::num_tokens_from_messages(model.id(), &messages)
|
tiktoken_rs::num_tokens_from_messages(model.id(), &messages)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.boxed()
|
.boxed()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue