Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/Persistent Context Token Counts #68

Merged
merged 3 commits into from
Jun 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removed obsolete state variable
  • Loading branch information
neCo2 committed May 25, 2024
commit 30f8838507a8ff31ef868b291846e062dfd548cc
18 changes: 6 additions & 12 deletions mikupad.html
Original file line number Diff line number Diff line change
@@ -3701,8 +3701,7 @@
}
// token counts for an
useEffect(() => {
setNKeepTimeout(false)
const order = ["prefix","text","suffix"]
const order = ["prefix","text","suffix"]
const assembled = authorNoteTokens.text && authorNoteTokens.text !== ""
? order.map(key => authorNoteTokens[key]).join("")
: "";
@@ -3728,8 +3727,7 @@
} catch (e) {
if (e.name !== 'AbortError'){
reportError(e);
setNKeepTimeout(true)
setAuthorNoteTokens((prevauthorNoteTokens) => ({ ...prevauthorNoteTokens, "tokens": 0 }))
setAuthorNoteTokens((prevauthorNoteTokens) => ({ ...prevauthorNoteTokens, "tokens": 0 }))
}
}
}, 500);
@@ -3743,8 +3741,7 @@
}
// token counts for memory
useEffect(() => {
setNKeepTimeout(false)
const order = ["prefix","text","suffix"]
const order = ["prefix","text","suffix"]
const assembled = memoryTokens.text && memoryTokens.text !== ""
? order.map(key => memoryTokens[key]).join("")
: "";
@@ -3771,8 +3768,7 @@
} catch (e) {
if (e.name !== 'AbortError'){
reportError(e);
setNKeepTimeout(true)
setMemoryTokens((prevMemoryTokens) => ({ ...prevMemoryTokens, "tokens": 0 }));
setMemoryTokens((prevMemoryTokens) => ({ ...prevMemoryTokens, "tokens": 0 }));
}
}
}, 500);
@@ -3782,8 +3778,7 @@
},[modalState["context"],memoryTokens.text,memoryTokens.prefix,memoryTokens.suffix,cancel,endpoint,endpointAPI])
// token counts for wi
useEffect(() => {
setNKeepTimeout(false)
const assembled = memoryTokens.worldInfo && memoryTokens.worldInfo !== ""
const assembled = memoryTokens.worldInfo && memoryTokens.worldInfo !== ""
? [worldInfo.prefix,memoryTokens.worldInfo,worldInfo.suffix].join("")
: "";
if (assembled == "" || endpointAPI == 3){
@@ -3809,8 +3804,7 @@
} catch (e) {
if (e.name !== 'AbortError'){
reportError(e);
setNKeepTimeout(true)
setMemoryTokens((prevMemoryTokens) => ({ ...prevMemoryTokens, "tokensWI": 0 }));
setMemoryTokens((prevMemoryTokens) => ({ ...prevMemoryTokens, "tokensWI": 0 }));
}
}
}, 500);