ollama no embedding by default

This commit is contained in:
MaxRobinsonTheGreat 2024-06-01 16:23:14 -05:00
parent ea4922e8f0
commit c8b6504221
2 changed files with 6 additions and 3 deletions

View file

@ -51,8 +51,12 @@ export class Prompter {
throw new Error('Unknown API:', api);
let embedding = this.prompts.embedding;
if (embedding === undefined)
embedding = {api: chat.api};
if (embedding === undefined) {
if (chat.api !== 'ollama')
embedding = {api: chat.api};
else
embedding = {api: 'none'};
}
else if (typeof embedding === 'string' || embedding instanceof String)
embedding = {api: embedding};

View file

@ -15,7 +15,6 @@ export class Local {
let res = null;
try {
console.log(`Awaiting local response... (model: ${model})`)
console.log('Messages:', messages);
res = await this.send(this.chat_endpoint, {model: model, messages: messages, stream: false});
if (res)
res = res['message']['content'];