Add Harunai Memory

This commit is contained in:
kwaroran
2024-04-23 22:07:44 +09:00
parent 376fa1641b
commit 2abd3bf15a
10 changed files with 198 additions and 81 deletions

View File

@@ -50,7 +50,8 @@ export const runSummarizer = async (text: string) => {
}
let extractor:FeatureExtractionPipeline = null
export const runEmbedding = async (text: string, model:'Xenova/all-MiniLM-L6-v2'|'nomic-ai/nomic-embed-text-v1.5' = 'Xenova/all-MiniLM-L6-v2'):Promise<Float32Array> => {
type EmbeddingModel = 'Xenova/all-MiniLM-L6-v2'|'nomic-ai/nomic-embed-text-v1.5'
export const runEmbedding = async (text: string, model:EmbeddingModel = 'Xenova/all-MiniLM-L6-v2'):Promise<Float32Array> => {
await initTransformers()
if(!extractor){
extractor = await pipeline('feature-extraction', model);