Skip to content

Commit

Permalink
improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 committed Dec 19, 2024
1 parent fc96c20 commit a28b1dd
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions tutorials/29_Serializing_Pipelines.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
]
}
],
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -413,7 +415,7 @@
{
"data": {
"text/plain": [
"{'llm': {'replies': [ChatMessage(content='Je me félicite des capybaras', role=<ChatRole.ASSISTANT: 'assistant'>, 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=<ChatRole.ASSISTANT: 'assistant'>, 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,
Expand Down

0 comments on commit a28b1dd

Please sign in to comment.