llama-index postprocessor xinference rerank integration
Project description
LlamaIndex Postprocessor Integration: Xinference Rerank
Xorbits Inference (Xinference) is an open-source platform to streamline the operation and integration of a wide array of AI models.
You can find a list of built-in rerank models in Xinference from its document Rerank Models
To learn more about Xinference in general, visit https://inference.readthedocs.io/en/stable/models/model_abilities/rerank.html
Installation
pip install llama-index-postprocessor-xinference-rerank
Usage
Parameters Description:
model
: Model uid not model name, sometimes they may be the same (e.g.,bge-reranker-base
).base_url
: base url of Xinference (e.g.,http://localhost:9997
).top_n
: Top n nodes to return from reranker. (default 5).
Nodes Rerank Example
from llama_index.postprocessor.xinference_rerank import XinferenceRerank
xi_model_uid = "xinference model uid"
xi_base_url = "xinference base url"
xi_rerank = XinferenceRerank(
top_n=5,
model=xi_model_uid,
base_url=xi_base_url,
)
def test_rerank_nodes(nodes, query_str):
response = xi_rerank.postprocess_nodes(nodes, query_str)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file llama_index_postprocessor_xinference_rerank-0.2.0.tar.gz
.
File metadata
- Download URL: llama_index_postprocessor_xinference_rerank-0.2.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9206716e3f9dec6fec5e2b10033efe3ae0fd27d73078e7c3e2e413e8b5db132e |
|
MD5 | d47045b4149dc21eda482d9a89f386c4 |
|
BLAKE2b-256 | 72a336dca9bae94dc175812b415a877172ac84a5ff359e19fbdec99f9655f3c3 |
File details
Details for the file llama_index_postprocessor_xinference_rerank-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_postprocessor_xinference_rerank-0.2.0-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 516237a8ec686edfcc9f4cef1a6055c1bb952f28274e0ccb2890c36aa9bf5133 |
|
MD5 | ebe6222cd783e30adb56ce2787c7684b |
|
BLAKE2b-256 | 93d33c7e154a52a0eb0d642f314b5d0cc3f6eaac06f50cfa7cc659a6da66da48 |