Added MCP, Hybrid Memories and Skill support
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import { pipeline } from '@xenova/transformers';
|
||||
import { pipeline } from '@huggingface/transformers';
|
||||
|
||||
const [modelDir, model] = process.argv.slice(2);
|
||||
|
||||
let text = '';
|
||||
process.stdin.on('data', chunk => text += chunk);
|
||||
process.stdin.on('end', async () => {
|
||||
const embedder = await pipeline('feature-extraction', 'Xenova/' + model, {quantized: true, cache_dir: modelDir});
|
||||
const embedder = await pipeline('feature-extraction', 'Xenova/' + model, {cache_dir: modelDir});
|
||||
const output = await embedder(text, { pooling: 'mean', normalize: true });
|
||||
const embedding = Array.from(output.data);
|
||||
console.log(JSON.stringify({embedding}));
|
||||
process.stdout.write(JSON.stringify({embedding}));
|
||||
process.exit();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user