mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-05-11 04:50:31 +00:00
fix: Catch AssertionError in countTokens() (#445)
This commit is contained in:
parent
7d89650062
commit
6fb0b8d30c
1 changed files with 3 additions and 2 deletions
|
|
@ -59,9 +59,10 @@ public final class EncodingManager {
|
|||
|
||||
public int countTokens(String text) {
|
||||
try {
|
||||
// #444: Cl100kParser.split() throws AssertionError "Input is not UTF-8: "
|
||||
return encoding.countTokens(text);
|
||||
} catch (Exception ex) {
|
||||
LOG.warn(ex);
|
||||
} catch (Exception | Error ex) {
|
||||
LOG.warn("Could not count tokens for: " + text, ex);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue