fix: pass model parameter for aphrodite tokenizer

This commit is contained in:
AlpinDale 2024-08-24 22:43:20 +00:00
parent 94d4fcc651
commit 62fed2ff6a
2 changed files with 3 additions and 1 deletions

View File

@ -838,6 +838,7 @@ function getTextgenAPITokenizationParams(str) {
url: getTextGenServer(),
legacy_api: textgen_settings.legacy_api && (textgen_settings.type === OOBA || textgen_settings.type === APHRODITE),
vllm_model: textgen_settings.vllm_model,
aphrodite_model: textgen_settings.aphrodite_model,
};
}

View File

@ -812,6 +812,7 @@ router.post('/remote/textgenerationwebui/encode', jsonParser, async function (re
const baseUrl = String(request.body.url);
const legacyApi = Boolean(request.body.legacy_api);
const vllmModel = String(request.body.vllm_model) || '';
const aphroditeModel = String(request.body.aphrodite_model) || '';
try {
const args = {
@ -847,7 +848,7 @@ router.post('/remote/textgenerationwebui/encode', jsonParser, async function (re
break;
case TEXTGEN_TYPES.APHRODITE:
url += '/v1/tokenize';
args.body = JSON.stringify({ 'prompt': text });
args.body = JSON.stringify({ 'model': aphroditeModel, 'prompt': text });
break;
default:
url += '/v1/internal/encode';