Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Mixtral to Mistral #59

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ For more examples, you may also find our [Blog](https://haystack.deepset.ai/blog
| Hacker News RAG with Custom Component | <a href="https://colab.research.google.com/github/deepset-ai/haystack-cookbook/blob/main/notebooks/hackernews-custom-component-rag.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>|
| Use Chroma for RAG and Indexing | <a href="https://colab.research.google.com/github/deepset-ai/haystack-cookbook/blob/main/notebooks/chroma-indexing-and-rag-examples.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>|
| Using the Jina-embeddings-v2-base-en model in a Haystack RAG pipeline for legal document analsysis| <a href="https://colab.research.google.com/github/deepset-ai/haystack-cookbook/blob/main/notebooks/jina-embeddings-v2-legal-analysis-rag.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>|
| Multilingual RAG from a podcast with Whisper, Qdrant and Mixtral| <a href="https://colab.research.google.com/github/deepset-ai/haystack-cookbook/blob/main/notebooks/multilingual_rag_podcast.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>|
| Multilingual RAG from a podcast with Whisper, Qdrant and Mistral| <a href="https://colab.research.google.com/github/deepset-ai/haystack-cookbook/blob/main/notebooks/multilingual_rag_podcast.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>|
| Improve retrieval by embedding meaningful metadata| <a href="https://colab.research.google.com/github/deepset-ai/haystack-cookbook/blob/main/notebooks/improve-retrieval-by-embedding-metadata.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>|
| Information extraction via LLMs (Gorilla OpenFunctions)| <a href="https://colab.research.google.com/github/deepset-ai/haystack-cookbook/blob/main/notebooks/information-extraction-gorilla.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>|
| Using AstraDB as a data store in your Haystack pipelines| <a href="https://colab.research.google.com/github/deepset-ai/haystack-cookbook/blob/main/notebooks/astradb_haystack_integration.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>|
Expand Down
4 changes: 2 additions & 2 deletions notebooks/chroma-indexing-and-rag-examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"\n",
"\n",
"In this example we are using:\n",
"- The `HuggingFaceTGIGenerator` with the Mistral 8x7B model. (You will need a Hugging Face token to use this model). You can repleace this with any of the other [`Generators`](https://docs.haystack.deepset.ai/v2.0/docs/generators)\n",
"- The `HuggingFaceTGIGenerator` with the Mistral-7B-Instruct-v0.1. (You will need a Hugging Face token to use this model). You can repleace this with any of the other [`Generators`](https://docs.haystack.deepset.ai/v2.0/docs/generators)\n",
"- The `PromptBuilder` which holds the prompt template. You can adjust this to a prompt of your choice\n",
"- The `ChromaQueryRetriver` which expects a list of queries and retieves the `top_k` most relevant documents from your Chroma collection."
]
Expand Down Expand Up @@ -161,7 +161,7 @@
"\"\"\"\n",
"prompt_builder = PromptBuilder(template=prompt)\n",
"\n",
"llm = HuggingFaceTGIGenerator(model=\"mistralai/Mixtral-8x7B-Instruct-v0.1\")\n",
"llm = HuggingFaceTGIGenerator(model=\"mistralai/Mistral-7B-Instruct-v0.1\")\n",
"llm.warm_up()\n",
"retriever = ChromaQueryTextRetriever(document_store)\n",
"\n",
Expand Down
6 changes: 3 additions & 3 deletions notebooks/jina-embeddings-v2-legal-analysis-rag.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"- the [`jina-embeddings-v2-base-en`](https://arxiv.org/abs/2310.19923) model\n",
"- [Haystack](https://haystack.deepset.ai/), the open source LLM orchestration framework, version [2.0-beta](https://docs.haystack.deepset.ai/v2.0/docs)\n",
"- [Chroma](https://docs.trychroma.com/getting-started) to store our vector embeddings, via the [Chroma Document Store Haystack integration](https://haystack.deepset.ai/integrations/chroma-documentstore)\n",
"- the open source [Mixtral 8x7B LLM](https://huggingface.co/docs/transformers/model_doc/mixtral)\n",
"- the open source [Mistral 7B Instruct LLM](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1)\n",
"\n",
"\n",
"## Prerequisites:\n",
Expand Down Expand Up @@ -191,7 +191,7 @@
"source": [
"# Query pipeline\n",
"\n",
"Now the real fun begins. Let's create a query pipeline so we can actually start asking questions. We write a prompt allowing us to pass our documents to the Mixtral-8x7B LLM. Then we initiatialize the LLM via the `HuggingFaceTGIGenerator`.\n",
"Now the real fun begins. Let's create a query pipeline so we can actually start asking questions. We write a prompt allowing us to pass our documents to the Mistral-7B LLM. Then we initiatialize the LLM via the `HuggingFaceTGIGenerator`.\n",
"\n",
"In Haystack 2.0 `retriever`s are tightly coupled to `DocumentStores`. If we pass in the `retriever` we initialized earlier, this pipeline can access those embeddings we generated, and pass them to the LLM."
]
Expand Down Expand Up @@ -221,7 +221,7 @@
"\"\"\"\n",
"\n",
"text_embedder = JinaTextEmbedder(model=\"jina-embeddings-v2-base-en\")\n",
"generator = HuggingFaceTGIGenerator(\"mistralai/Mixtral-8x7B-Instruct-v0.1\")\n",
"generator = HuggingFaceTGIGenerator(\"mistralai/Mistral-7B-Instruct-v0.1\")\n",
"generator.warm_up()\n",
"\n",
"prompt_builder = PromptBuilder(template=prompt)\n",
Expand Down
3 changes: 2 additions & 1 deletion notebooks/mixtral-8x7b-for-web-qa.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
"source": [
"## Prompt the Model - Standalone\n",
"\n",
"We are using Hugging Face [Text Generation interface](https://github.com/huggingface/text-generation-inference) (TGI) here. This required an API key 👇"
"We are using Hugging Face [Text Generation interface](https://github.com/huggingface/text-generation-inference) (TGI) here. This requires an API key 👇 \n",
"> Keep in mind that `mistralai/Mixtral-8x7B-Instruct-v0.1` model is not available on the free tier of Hugging Face Inference API."
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions notebooks/multilingual_rag_podcast.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"- OpenAI Whisper model for audio transcription\n",
"- Qdrant vector database\n",
"- multilingual embedding model: multilingual-e5-large\n",
"- multilingual LLM: Mixtral-8x7B-Instruct-v0.1"
"- multilingual LLM: Mistral-7B-Instruct-v0.1"
]
},
{
Expand Down Expand Up @@ -991,9 +991,9 @@
}
],
"source": [
"# load the model (https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1) and try the Generator\n",
"# load the model (https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1) and try the Generator\n",
"\n",
"generator = HuggingFaceTGIGenerator(\"mistralai/Mixtral-8x7B-Instruct-v0.1\",\n",
"generator = HuggingFaceTGIGenerator(\"mistralai/Mistral-7B-Instruct-v0.1\",\n",
" generation_kwargs={\"max_new_tokens\":500})\n",
"generator.warm_up()\n",
"\n",
Expand Down