mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-13 21:47:12 +00:00
community[patch]: Adopting the lighter-weight xinference_client (#21900)
While integrating the xinference_embedding, we observed that the downloaded dependency package is quite substantial in size. With a focus on resource optimization and efficiency, if the project requirements are limited to its vector processing capabilities, we recommend migrating to the xinference_client package. This package is more streamlined, significantly reducing the storage space requirements of the project and maintaining a feature focus, making it particularly suitable for scenarios that demand lightweight integration. Such an approach not only boosts deployment efficiency but also enhances the application's maintainability, rendering it an optimal choice for our current context. --------- Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
@@ -73,3 +73,13 @@ def test_xinference_embedding_query(setup: Tuple[str, str]) -> None:
|
||||
document = "foo bar"
|
||||
output = xinference.embed_query(document)
|
||||
assert len(output) == 4096
|
||||
|
||||
|
||||
def test_xinference_embedding() -> None:
|
||||
embedding_model = XinferenceEmbeddings(
|
||||
server_url="http://xinference-hostname:9997", model_uid="foo"
|
||||
)
|
||||
|
||||
embedding_model.embed_documents(
|
||||
texts=["hello", "i'm trying to upgrade xinference embedding"]
|
||||
)
|
||||
|
Reference in New Issue
Block a user