tzmtwtr's picture
remove typescript
12b24ca
raw
history blame
371 Bytes
import { env, pipeline } from "@xenova/transformers";
let pipe = null;
const piping = pipeline("feature-extraction", "sentence-transformers/paraphrase-multilingual-mpnet-base-v2", { local_files_only: true, quantized: true }).then(p => { pipe = p; })
export async function embedding_calc(text) {
await piping;
if (pipe) {
return await pipe(text);
}
}