May I ask if Haystack's DensePassageRetriever can use PromptNode
Is your feature request related to a problem? Please describe. May I ask if Haystack's DensePassageRetriever can use PromptNode
Describe the solution you'd like self.retriever = DensePassageRetriever( document_store=self.document_store, query_embedding_model="distilbert-base-multilingual-cased", # PromptNode api_key Hugging Face offers hosted Inference API ? use_gpu=use_gpu )
Hello @sandywk!
- the
DensePassageRetrievercan't use aPromptNodeasquery_embedding_modelorpassage_embedding_model, which require specific models. See also the docs. - Nowadays, unless you have specific requirements, I would use the
EmbeddingRetrieverinstead of theDensePassageRetriever. In fact, theEmbeddingRetrievergenerally performs better and you can also find a wide range of compatible models on the web.
Anyway, if you explain your use case and what you are trying to build, we can help you with better guidance!
Thank you for your answer.
I plan to write a customer service robot that supports importing private knowledge bases, mainly responding based on the entered knowledge bases.
Can this be supported
retriever = EmbeddingRetriever( document_store=document_store, batch_size=8, embedding_model="huggingface_model", api_key="<your_huggingface_User Access Tokens_here>", max_seq_len=1536 )
Or is there a way to reason without installing the model locally? Because this can accelerate the development process, downloading and installing various models will take a long time, and computer device resource requirements are high. @anakin87
Based on my knowledge, currently you can use the EmbeddingRetriever:
- with free models from Hugging Face, downloaded and used locally
- with paid models from OpenAI or Cohere, via API calls (no need to download and compute anything on your infrastructure)
As suggested in the docs, if currently you have limited resources (and no GPU), you can start with the BM25Retriever which is a light and good baseline for retrieval (it is keyword-based and not semantic).