From 6156e8e827c050d52d6a02d9ea8e37f111f8004d Mon Sep 17 00:00:00 2001 From: anakin87 Date: Tue, 27 Oct 2026 09:43:35 +0100 Subject: [PATCH 1/2] tutorial 30 - replace HF API model --- tutorials/30_File_Type_Preprocessing_Index_Pipeline.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tutorials/30_File_Type_Preprocessing_Index_Pipeline.ipynb b/tutorials/30_File_Type_Preprocessing_Index_Pipeline.ipynb index a10e439d..103676cd 100644 --- a/tutorials/30_File_Type_Preprocessing_Index_Pipeline.ipynb +++ b/tutorials/30_File_Type_Preprocessing_Index_Pipeline.ipynb @@ -312,7 +312,7 @@ "id": "I06qdWsZibSz" }, "source": [ - "Now, let's build a RAG pipeline that answers queries based on the documents you just created in the section above. For this step, we will be using the [`HuggingFaceAPIChatGenerator`](https://docs.haystack.deepset.ai/docs/huggingfaceapichatgenerator) so must have a [Hugging Face API Key](https://huggingface.co/settings/tokens) for this section. We will be using the `Qwen/Qwen3.5-9B` model." + "Now, let's build a RAG pipeline that answers queries based on the documents you just created in the section above. For this step, we will be using the [`HuggingFaceAPIChatGenerator`](https://docs.haystack.deepset.ai/docs/huggingfaceapichatgenerator) so must have a [Hugging Face API Key](https://huggingface.co/settings/tokens) for this section. We will be using the `Qwen/Qwen3-4B-Instruct-2507` model through the Nscale inference provider." ] }, { @@ -409,8 +409,8 @@ " \"llm\",\n", " HuggingFaceAPIChatGenerator(\n", " api_type=\"serverless_inference_api\",\n", - " api_params={\"model\": \"Qwen/Qwen3.5-9B\", \"provider\": \"together\"},\n", - " generation_kwargs={\"extra_body\": {\"chat_template_kwargs\": {\"enable_thinking\": False}}}\n", + " api_params={\"model\": \"Qwen/Qwen3-4B-Instruct-2507\", \"provider\": \"nscale\"},\n", + " generation_kwargs={\"max_tokens\": 1024},\n", " ),\n", ")\n", "\n", @@ -449,7 +449,7 @@ "id": "ZJueu_V4KP6w" }, "source": [ - "{'llm': {'replies': [ChatMessage(_role=, _content=[TextContent(text='To make vegan keto eggplant lasagna, vegan persimmon flan, and vegan hemp cheese, you would need the following ingredients:\\n\\n### Vegan Keto Eggplant Lasagna\\n- 2 large eggplants\\n- Salt (Hella salt)\\n- 1/2 cup store-bought vegan mozzarella for topping\\n- Pesto (ingredients: 4 oz basil, 1/4 cup almonds, 1/4 cup nutritional yeast, 1/4 cup olive oil, 1 recipe vegan pesto)\\n- Spinach Tofu Ricotta (14 oz firm or extra firm tofu, 10 oz spinach, juice of 1 lemon, garlic powder to taste, salt to taste)\\n- Macadamia Nut Cheese (1 cup macadamia nuts, 1/4 cup nutritional yeast, 1/4 cup olive oil, 1 recipe vegan pesto, 1 recipe spinach tofu ricotta, 1 tsp garlic powder, juice of half a lemon, salt to taste)\\n\\n### Vegan Persimmon Flan\\n- 2 average-sized fuyu persimmons, strained\\n- 1 tbsp cornstarch\\n- 1/2 tsp agar agar\\n- 1 tbsp agave nectar, or to taste\\n- 2 tbsp granulated sugar\\n- 1/4 cup coconut creme\\n- 1/2 cup almond milk\\n- 1/2 tsp vanilla\\n\\n### Vegan Hemp Cheese\\n- 1/2 cup sunflower seeds\\n- 1/2 cup hemp hearts\\n- 1.5 teaspoons miso paste\\n- 1 tsp nutritional yeast\\n- 1/4 cup rejuvelac\\n- 1/4th teaspoon salt, or to taste\\n\\n### Additional Tools and Notes\\n- Casserole dish (9 x 13)\\n- 2 ramekins\\n- Blender or food processor\\n- Saucepan\\n- Immersion blender (optional)\\n- Clean glass bowl\\n- Rubber band\\n- Dish towel\\n- Knife\\n- Hot water bath method (for flan)\\n\\nThese ingredients and tools will allow you to prepare all three dishes as described in the provided context.')], _name=None, _meta={'model': 'Qwen/Qwen3.5-9B', 'finish_reason': 'stop', 'index': 0, 'usage': {'prompt_tokens': 2031, 'completion_tokens': 446}})]}}" + "{'llm': {'replies': [ChatMessage(_role=, _content=[TextContent(text='To make **vegan keto eggplant lasagna**, **vegan persimmon flan**, and **vegan hemp cheese**, based on the provided context, here are the required ingredients for each dish:\\n\\n---\\n\\n### 🥘 **Vegan Keto Eggplant Lasagna**\\n\\n**Ingredients:**\\n- 2 large eggplants \\n- A lot of salt (to draw out water; rub both sides) \\n- 1/3 cup pesto (made with: 4 oz basil, 1/4 cup almonds, 1/4 cup nutritional yeast, 1/4 cup olive oil) \\n- 1/2 cup store-bought vegan mozzarella (or optional layer of Violife shredded mozz or Miyoko’s) \\n- 1 recipe spinach tofu ricotta (made with: 14 oz firm/extra firm tofu, 10 oz spinach, 1 tsp garlic powder, juice of 1/2 lemon, salt to taste) \\n- Optional: 1 layer of store-bought vegan cheese on top \\n\\n**Notes:** \\n- Eggplant is roasted, salted, and then layered with pesto, cheese, and spinach tofu ricotta. \\n- The dish is keto-friendly due to the use of minimal carbohydrates (spinach and tofu are low-carb, and pesto/nutritional yeast are low in net carbs). \\n- Do not freeze eggplant; store in fridge for up to a few days.\\n\\n---\\n\\n### 🥣 **Vegan Persimmon Flan**\\n\\n**Ingredients:**\\n- ½ cup persimmon pulp (strained from 2 average-sized fuyu persimmons; seeds removed) \\n- 1 tbsp cornstarch \\n- ½ tsp agar agar \\n- 1 tbsp agave nectar (or to taste) \\n- 2 tbsp granulated sugar \\n- ¼ cup coconut cream \\n- ½ cup almond milk \\n- ½ tsp vanilla \\n\\n**Notes:** \\n- Cook the mixture in a saucepan, bring to a boil, and simmer. \\n- Cool slightly, stir in vanilla, then refrigerate for at least 4 hours or overnight. \\n- Serves 2 (written during pandemic, so small batch). \\n- This is a low-carb, keto-friendly dessert option.\\n\\n---\\n\\n### 🥛 **Vegan Hemp Cheese** (Note: This is a *hemp-based* cheese, not from the macadamia nut cheese)\\n\\n**Ingredients:**\\n- ½ cup sunflower seeds (soaked overnight or boiled for 15 minutes) \\n- ½ cup hemp hearts \\n- 1.5 teaspoons miso paste \\n- 1 tsp nutritional yeast \\n- ¼ cup rejuvelac \\n- 1/4 tsp salt (or to taste) \\n\\n**Instructions (from context):** \\n- Blend all ingredients in a blender or food processor. \\n- Transfer to a clean glass bowl, cover with a dish towel and rubber band. \\n- Culture at room temperature (not in direct sunlight) for 24–48 hours. \\n- The cheese will become tangy, like sourdough bread. \\n\\n**Note:** This is a fermented, low-carb, plant-based cheese. It’s not keto-friendly in large amounts due to carbs from seeds and miso, but it can be consumed in small portions. \\n\\n---\\n\\n### ✅ Final Answer:\\n\\n**Ingredients needed:**\\n\\n#### For **Vegan Keto Eggplant Lasagna**:\\n- 2 large eggplants \\n- Salt (a lot) \\n- 1/3 cup pesto (basil, almonds, nutritional yeast, olive oil) \\n- 1/2 cup store-bought vegan mozzarella (e.g., Violife or Miyoko’s) \\n- 14 oz firm tofu \\n- 10 oz spinach \\n- 1 tsp garlic powder \\n- Juice of 1/2 lemon \\n- Salt to taste \\n\\n#### For **Vegan Persimmon Flan**:\\n- ½ cup persimmon pulp (from 2 fuyu persimmons) \\n- 1 tbsp cornstarch \\n- ½ tsp agar agar \\n- 1 tbsp agave nectar \\n- 2 tbsp granulated sugar \\n- ¼ cup coconut cream \\n- ½ cup almond milk \\n- ½ tsp vanilla \\n\\n#### For **Vegan Hemp Cheese**:\\n- ½ cup sunflower seeds (soaked or boiled) \\n- ½ cup hemp hearts \\n- 1.5 tsp miso paste \\n- 1 tsp nutritional yeast \\n- ¼ cup rejuvelac \\n- 1/4 tsp salt \\n\\n> ✅ All dishes are vegan. The eggplant lasagna is keto-friendly due to low-carb ingredients. The flan and hemp cheese are also low-carb, though the hemp cheese has some carbs from seeds and miso. \\n\\nThis combination gives a balanced, plant-based, and keto-friendly meal and dessert pairing.')], _name=None, _meta={'model': 'Qwen/Qwen3-4B-Instruct-2507', 'finish_reason': 'stop', 'index': 0, 'usage': {'prompt_tokens': 2010, 'completion_tokens': 1023}})]}}" ] }, { From b788ef4dab51b38664725ec1ca265126527b3bb8 Mon Sep 17 00:00:00 2001 From: anakin87 Date: Tue, 27 Oct 2026 09:44:51 +0100 Subject: [PATCH 2/2] clean uo --- tutorials/30_File_Type_Preprocessing_Index_Pipeline.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/30_File_Type_Preprocessing_Index_Pipeline.ipynb b/tutorials/30_File_Type_Preprocessing_Index_Pipeline.ipynb index 103676cd..6736c11b 100644 --- a/tutorials/30_File_Type_Preprocessing_Index_Pipeline.ipynb +++ b/tutorials/30_File_Type_Preprocessing_Index_Pipeline.ipynb @@ -312,7 +312,7 @@ "id": "I06qdWsZibSz" }, "source": [ - "Now, let's build a RAG pipeline that answers queries based on the documents you just created in the section above. For this step, we will be using the [`HuggingFaceAPIChatGenerator`](https://docs.haystack.deepset.ai/docs/huggingfaceapichatgenerator) so must have a [Hugging Face API Key](https://huggingface.co/settings/tokens) for this section. We will be using the `Qwen/Qwen3-4B-Instruct-2507` model through the Nscale inference provider." + "Now, let's build a RAG pipeline that answers queries based on the documents you just created in the section above. For this step, we will be using the [`HuggingFaceAPIChatGenerator`](https://docs.haystack.deepset.ai/docs/huggingfaceapichatgenerator) so must have a [Hugging Face API Key](https://huggingface.co/settings/tokens) for this section. We will be using the `Qwen/Qwen3-4B-Instruct-2507` model." ] }, {