mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Set 0 tokens for prompts with no content
This commit is contained in:
@ -1417,7 +1417,7 @@ class Message {
|
||||
this.role = role;
|
||||
this.content = content;
|
||||
|
||||
if (typeof this.content === 'string') {
|
||||
if (typeof this.content === 'string' && this.content.length > 0) {
|
||||
this.tokens = tokenHandler.count({ role: this.role, content: this.content });
|
||||
} else {
|
||||
this.tokens = 0;
|
||||
|
Reference in New Issue
Block a user