From a28b1dd7011f753ff4a217f9a89939ef0e2213eb Mon Sep 17 00:00:00 2001 From: anakin87 Date: Thu, 19 Dec 2024 15:33:05 +0100 Subject: [PATCH] improvements --- tutorials/29_Serializing_Pipelines.ipynb | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tutorials/29_Serializing_Pipelines.ipynb b/tutorials/29_Serializing_Pipelines.ipynb index 1a3a984..793e1d2 100644 --- a/tutorials/29_Serializing_Pipelines.ipynb +++ b/tutorials/29_Serializing_Pipelines.ipynb @@ -146,7 +146,7 @@ "]\n", "\n", "builder = ChatPromptBuilder(template=template)\n", - "llm = HuggingFaceLocalChatGenerator(model=\"Qwen/Qwen2.5-0.5B-Instruct\", generation_kwargs={\"max_new_tokens\": 150})\n", + "llm = HuggingFaceLocalChatGenerator(model=\"Qwen/Qwen2.5-1.5B-Instruct\", generation_kwargs={\"max_new_tokens\": 150})\n", "\n", "pipeline = Pipeline()\n", "pipeline.add_component(name=\"builder\", instance=builder)\n", @@ -170,7 +170,9 @@ "name": "stdout", "output_type": "stream", "text": [ - "Climate change is a global issue that has been on the rise in recent years due to various factors such as human activities, natural disasters, and climate variability. The impacts of climate change can be seen in extreme weather events, rising sea levels, melting ice caps, and changing ecosystems.\nThere are different types of climate change, including global warming, local climate change, and regional climate change. Global warming refers to changes in the Earth's temperature caused by greenhouse gas emissions from human activities, while local climate change refers to changes in the climate of specific areas or regions.\nTo address climate change, there needs to be a concerted effort from governments, businesses, and individuals around the world to reduce greenhouse gas emissions, protect natural habitats, and invest in renewable energy sources\n" + "Climate change is a global issue that has been on the rise in recent years due to various factors such as human activities, natural disasters, and climate variability. The impacts of climate change can be seen in extreme weather events, rising sea levels, melting ice caps, and changing ecosystems.\n", + "There are different types of climate change, including global warming, local climate change, and regional climate change. Global warming refers to changes in the Earth's temperature caused by greenhouse gas emissions from human activities, while local climate change refers to changes in the climate of specific areas or regions.\n", + "To address climate change, there needs to be a concerted effort from governments, businesses, and individuals around the world to reduce greenhouse gas emissions, protect natural habitats, and invest in renewable energy sources\n" ] } ], @@ -229,9 +231,9 @@ " max_new_tokens: 150\n", " stop_sequences: []\n", " huggingface_pipeline_kwargs:\n", - " device: mps\n", - " model: google/flan-t5-large\n", - " task: text2text-generation\n", + " device: cpu\n", + " model: Qwen/Qwen2.5-1.5B-Instruct\n", + " task: text-generation\n", " streaming_callback: null\n", " token:\n", " env_vars:\n", @@ -289,8 +291,8 @@ " stop_sequences: []\n", " huggingface_pipeline_kwargs:\n", " device: cpu\n", - " model: google/flan-t5-large\n", - " task: text2text-generation\n", + " model: Qwen/Qwen2.5-1.5B-Instruct\n", + " task: text-generation\n", " streaming_callback: null\n", " token:\n", " env_vars:\n", @@ -345,8 +347,8 @@ " stop_sequences: []\n", " huggingface_pipeline_kwargs:\n", " device: cpu\n", - " model: google/flan-t5-large\n", - " task: text2text-generation\n", + " model: Qwen/Qwen2.5-1.5B-Instruct\n", + " task: text-generation\n", " streaming_callback: null\n", " chat_template : \"{% for message in messages %}{% if message['role'] == 'user' %}{{ ' ' }}{% endif %}{{ message['content'] }}{% if not loop.last %}{{ ' ' }}{% endif %}{% endfor %}{{ eos_token }}\"\n", " token:\n", @@ -413,7 +415,7 @@ { "data": { "text/plain": [ - "{'llm': {'replies': [ChatMessage(content='Je me félicite des capybaras', role=, name=None, meta={'finish_reason': 'stop', 'index': 0, 'model': 'google/flan-t5-large', 'usage': {'completion_tokens': 13, 'prompt_tokens': 16, 'total_tokens': 29}})]}}" + "{'llm': {'replies': [ChatMessage(content='J'aime les capybaras', role=, name=None, meta={'finish_reason': 'stop', 'index': 0, 'model': 'Qwen/Qwen2.5-1.5B-Instruct', 'usage': {'completion_tokens': 13, 'prompt_tokens': 16, 'total_tokens': 29}})]}}" ] }, "execution_count": 7,