Commit e689f160 by Michael Pastushkov

fix

parent d7205241
......@@ -65,8 +65,13 @@ class ConversationManager {
model: this.model,
messages: messages,
stream: true,
keep_alive: '1m', // 'inf', // '1m' keeps model in RAM
// options: { num_ctx: 8192 } // optional: larger context if your model supports it
keep_alive: "5m",
options: {
num_ctx: 1024,
num_predict: 256,
num_thread: 4,
num_batch: 1024
}
});
// Making the main request to model
......
......@@ -29,8 +29,14 @@ class TopicRouter {
body: JSON.stringify({
model: this.labelModel,
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)
return null;
......@@ -88,7 +94,15 @@ class TopicRouter {
utils.log(`model: ${this.embedModel}`, 5);
const r = await fetch('http://127.0.0.1:11434/api/embeddings', {
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);
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