Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement[Community]Improve Embeddings API #28038

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libs/community/langchain_community/embeddings/baichuan.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from requests import RequestException
from typing_extensions import Self

BAICHUAN_API_URL: str = "http://api.baichuan-ai.com/v1/embeddings"
BAICHUAN_API_URL: str = "https://api.baichuan-ai.com/v1/embeddings"

# BaichuanTextEmbeddings is an embedding model provided by Baichuan Inc. (https://www.baichuan-ai.com/home).
# As of today (Jan 25th, 2024) BaichuanTextEmbeddings ranks #1 in C-MTEB
Expand All @@ -25,7 +25,7 @@
# Official Website: https://platform.baichuan-ai.com/docs/text-Embedding
# An API-key is required to use this embedding model. You can get one by registering
# at https://platform.baichuan-ai.com/docs/text-Embedding.
# BaichuanTextEmbeddings support 512 token window and preduces vectors with
# BaichuanTextEmbeddings support 512 token window and produces vectors with
# 1024 dimensions.


Expand Down
2 changes: 0 additions & 2 deletions libs/community/langchain_community/embeddings/dashscope.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@ def embed_documents(self, texts: List[str]) -> List[List[float]]:

Args:
texts: The list of texts to embed.
chunk_size: The chunk size of embeddings. If None, will use the chunk size
specified by the class.

Returns:
List of embeddings, one for each text.
Expand Down
3 changes: 2 additions & 1 deletion libs/community/langchain_community/embeddings/fake.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def _get_embedding(self, seed: int) -> List[float]:
np.random.seed(seed)
return list(np.random.normal(size=self.size))

def _get_seed(self, text: str) -> int:
@staticmethod
def _get_seed(text: str) -> int:
"""
Get a seed for the random generator, using the hash of the text.
"""
Expand Down
Loading