kevkibe / docindex Goto Github PK
View Code? Open in Web Editor NEW⚡️Framework for fast persistent storage of multiple document embeddings and metadata into Pinecone for source-traceable, production-level RAG.
License: MIT License
⚡️Framework for fast persistent storage of multiple document embeddings and metadata into Pinecone for source-traceable, production-level RAG.
License: MIT License
RerankerConfig
, add all the SUPPORTED_MODELSclass RerankerConfig:
SUPPORTED_MODELS = {
'cohere': {'lang': True, 'api_key': True},
'jina': {'api_key': True},
# Add other models and their required parameters here
}
@staticmethod
def get_ranker(rerank_model: str, lang: str = None, api_key: str = None) -> Reranker:
"""
Returns a Reranker instance based on the provided parameters.
Args:
rerank_model (str): The name or path of the model.
lang (str, optional): The language for multilingual models. Defaults to None.
api_key (str, optional): The API key for models accessed through an API. Defaults to None.
Returns:
Reranker: An instance of Reranker.
Raises:
ValueError: If unsupported rerank_model is provided.
"""
if rerank_model not in RerankerConfig.SUPPORTED_MODELS:
raise ValueError(f"Unsupported rerank_model provided: {rerank_model}")
model_config = RerankerConfig.SUPPORTED_MODELS[rerank_model]
return Reranker(rerank_model, lang=lang if model_config.get('lang') else None,
api_key=api_key if model_config.get('api_key') else None)
vectorstore.as_retriever
default similarity score.First of all great work. I was looking to contribute to the repo but the design is a bit a limiting factor. This is my idea though and you can tell me your thoughts.
First you have only focused on pinecone, what if someone wants to use milvus, or chroma or faiss or qdrant?
The indexing part , you have used the default splitter of loaders. But that's not usually enough based on my experience. What if I want to use recursive character splitter, or spacy's sentence splitter?
The loading part is okay as you have catered for multiple files and can be easily scaled to other documents too. But you have hidden it , it is not easily retrievable.
You current design: embedding to other steps . My proposed design to make this generalizable and useful to other choices too.
My suggestion break each part into its own module:
document_loaders, embedding models, splitters , vectordatabases to make each step scalable independently and lastly build a retrieval step that is easily flexible to the modules created.
I would love to help in this redesigning if it is something you are willing to work on
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.