-
-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from n4ze3m/next
cohere, huggingface embedding
- Loading branch information
Showing
15 changed files
with
173 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
export const availableEmbeddingTypes = [ | ||
{ value: "openai", label: "OpenAI" }, | ||
{ value: "tensorflow", label: "Tensorflow" }, | ||
// { value: "cohere", label: "Cohere"} | ||
{ value: "cohere", label: "Cohere"}, | ||
{ value: "huggingface-api", label: "HuggingFace (Inference)"} | ||
]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
import "@tensorflow/tfjs-backend-cpu"; | ||
import { TensorFlowEmbeddings } from "langchain/embeddings/tensorflow"; | ||
import { OpenAIEmbeddings } from "langchain/embeddings/openai"; | ||
import { CohereEmbeddings } from "langchain/embeddings/cohere"; | ||
import { HuggingFaceInferenceEmbeddings } from "langchain/embeddings/hf"; | ||
|
||
export const embeddings = (embeddingsType: string) => { | ||
switch (embeddingsType) { | ||
case "tensorflow": | ||
return new TensorFlowEmbeddings(); | ||
case "openai": | ||
return new OpenAIEmbeddings(); | ||
case "cohere": | ||
return new CohereEmbeddings(); | ||
case "huggingface-api": | ||
return new HuggingFaceInferenceEmbeddings(); | ||
default: | ||
return new OpenAIEmbeddings(); | ||
} | ||
}; | ||
}; |
Oops, something went wrong.