mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-09 08:38:53 +01:00
Make API tokenization work again for ooba
This commit is contained in:
parent
3830347d81
commit
a96aad6073
@ -4005,8 +4005,10 @@ app.post("/tokenize_via_api", jsonParser, async function (request, response) {
|
|||||||
headers: { "Content-Type": "application/json" }
|
headers: { "Content-Type": "application/json" }
|
||||||
};
|
};
|
||||||
|
|
||||||
if (main_api == 'textgenerationwebui' && request.body.use_mancer) {
|
if (main_api == 'textgenerationwebui') {
|
||||||
args.headers = Object.assign(args.headers, get_mancer_headers());
|
if (request.body.use_mancer) {
|
||||||
|
args.headers = Object.assign(args.headers, get_mancer_headers());
|
||||||
|
}
|
||||||
const data = await postAsync(api_server + "/v1/token-count", args);
|
const data = await postAsync(api_server + "/v1/token-count", args);
|
||||||
return response.send({ count: data['results'][0]['tokens'] });
|
return response.send({ count: data['results'][0]['tokens'] });
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user