Haystack v1.13 adds stop words for PromptNode, ImageToText and CsvTextConverter nodes, tiktoken support, and HA for Weaviate.
$ git clone --branch v1.13.0 https://github.com/deepset-ai/haystack.git # already have the repo? check out this version: $ git checkout v1.13.0
from haystack.nodes import PromptNode
pn = PromptNode(
model_name_or_path='text-davinci-003',
stop_words=['\nHuman:', 'END']
)
result = pn.run(prompt='Summarize the following document: ...') - ›Adds
stop_wordslist parameter toPromptNodeto halt LLM text generation when any stop word is encountered; stop words are excluded from the response. - ›Adds
indexparameter toTfidfRetrieverto specify which index to query. - ›Adds
knn_engineparameter toSearchEngineDocumentStoreto makescore_scripta first-class citizen for KNN search. - ›New
ImageToTextnode generates captions from image files and produces Haystack Document objects from them. - ›New
CsvTextConverternode loads CSV files of FAQ question-answer pairs and sends them to aDocumentStorefor FAQ matching pipelines.
+10 moreshow less
- ›Adds retry with exponential back-off to
PromptNode's OpenAI model integrations. - ›Supports
cl100k_basetokenization via OpenAI'stiktokenlibrary for dramatically faster tokenization of GPT models; falls back to HuggingFace tokenizers on unsupported platforms (Python < 3.8, arm64, macOS). - ›Adds high-availability (HA) support for the Weaviate
DocumentStore. - ›Enables
text-embedding-ada-002model forEmbeddingRetriever. - ›Updates Cohere embedding models support and adds use of Cohere's
truncateoption inCohere.embed. - ›Stores
id_hash_keysin Document objects to make documents clonable. - ›Adds async functionality support for Ray Serve pipelines.
- ›Makes new sklearn models the default in
QueryClassifier. - ›Adds
PromptModel,PromptNode, andPromptTemplateto expand LLM support. - ›Raises a warning in Preprocessor when a document's length exceeds the configured threshold.
- !Native PyTorch AMP replaces the previous AMP integration; existing code relying on the old AMP behaviour will break.
- !
invocation_contextis moved frommetato its own pipeline variable; code readingmeta['invocation_context']will break. - !The
batch_sizeparameter names in distillation are renamed for consistency; existing calls using the old names will break.