mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-13 10:30:14 +01:00
Fix logprobs menu on empty chats
This commit is contained in:
parent
83e75439ab
commit
76cb34fd06
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user