Merge pull request #1115 from SillyTavern/release

Release
This commit is contained in:
Cohee 2023-09-08 12:48:37 +03:00 committed by GitHub
commit 3abee9e37a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -4004,8 +4004,10 @@ app.post("/tokenize_via_api", jsonParser, async function (request, response) {
headers: { "Content-Type": "application/json" }
};
if (main_api == 'textgenerationwebui' && request.body.use_mancer) {
if (main_api == 'textgenerationwebui') {
if (request.body.use_mancer) {
args.headers = Object.assign(args.headers, get_mancer_headers());
}
const data = await postAsync(api_server + "/v1/token-count", args);
return response.send({ count: data['results'][0]['tokens'] });
}