mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix logprobs menu on empty chats
This commit is contained in:
@ -496,9 +496,13 @@ function getMessageHash(message) {
|
|||||||
/**
|
/**
|
||||||
* getActiveMessageLogprobData returns the logprobs data for the active chat
|
* getActiveMessageLogprobData returns the logprobs data for the active chat
|
||||||
* message.
|
* message.
|
||||||
* @returns {MessageLogprobData || null}
|
* @returns {MessageLogprobData|null}
|
||||||
*/
|
*/
|
||||||
function getActiveMessageLogprobData() {
|
function getActiveMessageLogprobData() {
|
||||||
|
if (chat.length === 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const hash = getMessageHash(chat[chat.length - 1]);
|
const hash = getMessageHash(chat[chat.length - 1]);
|
||||||
return state.messageLogprobs.get(hash) || null;
|
return state.messageLogprobs.get(hash) || null;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user