Fix ooba tokenization via API. Fix requiring streaming URL to generate

This commit is contained in:
Cohee
2023-11-08 03:38:04 +02:00
parent b2629d9718
commit 865256f5c0
4 changed files with 61 additions and 37 deletions

View File

@ -1,4 +1,4 @@
import { characters, main_api, nai_settings, online_status, this_chid } from "../script.js";
import { api_server, api_server_textgenerationwebui, characters, getAPIServerUrl, main_api, nai_settings, online_status, this_chid } from "../script.js";
import { power_user, registerDebugFunction } from "./power-user.js";
import { chat_completion_sources, model_list, oai_settings } from "./openai.js";
import { groups, selected_group } from "./group-chats.js";
@ -376,7 +376,11 @@ function countTokensRemote(endpoint, str, padding) {
async: false,
type: 'POST',
url: endpoint,
data: JSON.stringify({ text: str }),
data: JSON.stringify({
text: str,
api: main_api,
url: getAPIServerUrl(),
}),
dataType: "json",
contentType: "application/json",
success: function (data) {