Commit e689f160 by Michael Pastushkov

fix

parent d7205241
...@@ -65,8 +65,13 @@ class ConversationManager { ...@@ -65,8 +65,13 @@ class ConversationManager {
model: this.model, model: this.model,
messages: messages, messages: messages,
stream: true, stream: true,
keep_alive: '1m', // 'inf', // '1m' keeps model in RAM keep_alive: "5m",
// options: { num_ctx: 8192 } // optional: larger context if your model supports it options: {
num_ctx: 1024,
num_predict: 256,
num_thread: 4,
num_batch: 1024
}
}); });
// Making the main request to model // Making the main request to model
......
...@@ -29,8 +29,14 @@ class TopicRouter { ...@@ -29,8 +29,14 @@ class TopicRouter {
body: JSON.stringify({ body: JSON.stringify({
model: this.labelModel, model: this.labelModel,
messages: [{ role: 'system', content: sys }, { role: 'user', content: text }], messages: [{ role: 'system', content: sys }, { role: 'user', content: text }],
stream: false stream: false,
}) options: {
num_ctx: 1024,
num_predict: 256,
num_thread: 4,
num_batch: 1024
}
}),
}); });
if (!r.ok) if (!r.ok)
return null; return null;
...@@ -88,7 +94,15 @@ class TopicRouter { ...@@ -88,7 +94,15 @@ class TopicRouter {
utils.log(`model: ${this.embedModel}`, 5); utils.log(`model: ${this.embedModel}`, 5);
const r = await fetch('http://127.0.0.1:11434/api/embeddings', { const r = await fetch('http://127.0.0.1:11434/api/embeddings', {
method: 'POST', headers: { 'Content-Type': 'application/json' }, method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ model: this.embedModel, prompt: text }) body: JSON.stringify({
model: this.embedModel,
prompt: text ,
options: {
num_ctx: 1024,
num_predict: 256,
num_thread: 4,
num_batch: 1024
}})
}); });
utils.log('Embed done', 5); utils.log('Embed done', 5);
if (!r.ok) if (!r.ok)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment