Fix HuggingFace embedding API deprecated endpoints issue
Co-authored-by: HenryHengZJ <26460777+HenryHengZJ@users.noreply.github.com>
This commit is contained in:
parent
858e878def
commit
d26ef485b9
|
|
@ -1,6 +1,6 @@
|
||||||
import { INode, INodeData, INodeParams } from '../../../src/Interface'
|
import { INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||||
import { getBaseClasses } from '../../../src/utils'
|
import { getBaseClasses } from '../../../src/utils'
|
||||||
import { HuggingFaceInferenceEmbeddings, HuggingFaceInferenceEmbeddingsParams } from './core'
|
import { HuggingFaceInferenceEmbeddings, HuggingFaceInferenceEmbeddingsParams } from '@langchain/community/dist/embeddings/hf.cjs'
|
||||||
|
|
||||||
class HuggingFaceInferenceEmbedding_Embeddings implements INode {
|
class HuggingFaceInferenceEmbedding_Embeddings implements INode {
|
||||||
label: string
|
label: string
|
||||||
|
|
@ -53,7 +53,7 @@ class HuggingFaceInferenceEmbedding_Embeddings implements INode {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (modelName) obj.model = modelName
|
if (modelName) obj.model = modelName
|
||||||
if (endpoint) obj.endpoint = endpoint
|
if (endpoint) obj.endpointUrl = endpoint
|
||||||
|
|
||||||
const model = new HuggingFaceInferenceEmbeddings(obj)
|
const model = new HuggingFaceInferenceEmbeddings(obj)
|
||||||
return model
|
return model
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { HfInference } from '@huggingface/inference'
|
import { HfInference } from '@huggingface/inference'
|
||||||
import { Embeddings, EmbeddingsParams } from 'langchain/embeddings/base'
|
import { Embeddings, EmbeddingsParams } from '@langchain/core/embeddings'
|
||||||
import { getEnvironmentVariable } from '../../../src/utils'
|
import { getEnvironmentVariable } from '../../../src/utils'
|
||||||
|
|
||||||
export interface HuggingFaceInferenceEmbeddingsParams extends EmbeddingsParams {
|
export interface HuggingFaceInferenceEmbeddingsParams extends EmbeddingsParams {
|
||||||
|
|
@ -19,7 +19,11 @@
|
||||||
"@aws-sdk/client-dynamodb": "^3.360.0",
|
"@aws-sdk/client-dynamodb": "^3.360.0",
|
||||||
"@dqbd/tiktoken": "^1.0.7",
|
"@dqbd/tiktoken": "^1.0.7",
|
||||||
"@getzep/zep-js": "^0.4.1",
|
"@getzep/zep-js": "^0.4.1",
|
||||||
"@huggingface/inference": "^2.6.1",
|
"@huggingface/inference": "^4.0.5",
|
||||||
|
"@langchain/community": "^0.3.56",
|
||||||
|
"@langchain/core": "^0.3.78",
|
||||||
|
"@langchain/community": "^0.3.56",
|
||||||
|
"@langchain/core": "^0.3.78",
|
||||||
"@opensearch-project/opensearch": "^1.2.0",
|
"@opensearch-project/opensearch": "^1.2.0",
|
||||||
"@pinecone-database/pinecone": "^0.0.12",
|
"@pinecone-database/pinecone": "^0.0.12",
|
||||||
"@qdrant/js-client-rest": "^1.2.2",
|
"@qdrant/js-client-rest": "^1.2.2",
|
||||||
|
|
@ -37,10 +41,11 @@
|
||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
"graphql": "^16.6.0",
|
"graphql": "^16.6.0",
|
||||||
"html-to-text": "^9.0.5",
|
"html-to-text": "^9.0.5",
|
||||||
"langchain": "^0.0.112",
|
"langchain": "^0.3.34",
|
||||||
"linkifyjs": "^4.1.1",
|
"linkifyjs": "^4.1.1",
|
||||||
"mammoth": "^1.5.1",
|
"mammoth": "^1.5.1",
|
||||||
"moment": "^2.29.3",
|
"moment": "^2.29.3",
|
||||||
|
"mysql2": "^3.5.1",
|
||||||
"node-fetch": "^2.6.11",
|
"node-fetch": "^2.6.11",
|
||||||
"node-html-markdown": "^1.3.0",
|
"node-html-markdown": "^1.3.0",
|
||||||
"pdf-parse": "^1.1.1",
|
"pdf-parse": "^1.1.1",
|
||||||
|
|
@ -52,8 +57,7 @@
|
||||||
"srt-parser-2": "^1.2.3",
|
"srt-parser-2": "^1.2.3",
|
||||||
"vm2": "^3.9.19",
|
"vm2": "^3.9.19",
|
||||||
"weaviate-ts-client": "^1.1.0",
|
"weaviate-ts-client": "^1.1.0",
|
||||||
"ws": "^8.9.0",
|
"ws": "^8.9.0"
|
||||||
"mysql2": "^3.5.1"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/gulp": "4.0.9",
|
"@types/gulp": "4.0.9",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue