mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-11-21 20:48:14 +00:00
Compare commits
2 Commits
eef6ebb924
...
3d2d056f64
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d2d056f64 | ||
|
|
d9ebf611ff |
@@ -16,7 +16,7 @@ const Chat = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const updateDividerWidth = () => {
|
const updateDividerWidth = () => {
|
||||||
if (dividerRef.current) {
|
if (dividerRef.current) {
|
||||||
setDividerWidth(dividerRef.current.scrollWidth);
|
setDividerWidth(dividerRef.current.offsetWidth);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Embeddings, type EmbeddingsParams } from '@langchain/core/embeddings';
|
import { Embeddings, type EmbeddingsParams } from '@langchain/core/embeddings';
|
||||||
import { chunkArray } from '@langchain/core/utils/chunk_array';
|
import { chunkArray } from '@langchain/core/utils/chunk_array';
|
||||||
import { pipeline } from '@huggingface/transformers';
|
|
||||||
|
|
||||||
export interface HuggingFaceTransformersEmbeddingsParams
|
export interface HuggingFaceTransformersEmbeddingsParams
|
||||||
extends EmbeddingsParams {
|
extends EmbeddingsParams {
|
||||||
@@ -68,6 +67,7 @@ export class HuggingFaceTransformersEmbeddings
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async runEmbedding(texts: string[]) {
|
private async runEmbedding(texts: string[]) {
|
||||||
|
const { pipeline } = await import('@huggingface/transformers');
|
||||||
const pipe = await pipeline('feature-extraction', this.model);
|
const pipe = await pipeline('feature-extraction', this.model);
|
||||||
|
|
||||||
return this.caller.call(async () => {
|
return this.caller.call(async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user