|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "raw", |
5 | | - "metadata": {}, |
| 5 | + "metadata": { |
| 6 | + "vscode": { |
| 7 | + "languageId": "raw" |
| 8 | + } |
| 9 | + }, |
6 | 10 | "source": [ |
7 | 11 | "---\n", |
8 | | - "sidebar_label: Friendli\n", |
| 12 | + "sidebar_label: ChatFriendli\n", |
9 | 13 | "---" |
10 | 14 | ] |
11 | 15 | }, |
|
37 | 41 | }, |
38 | 42 | { |
39 | 43 | "cell_type": "code", |
40 | | - "execution_count": 1, |
| 44 | + "execution_count": 2, |
41 | 45 | "metadata": {}, |
42 | 46 | "outputs": [], |
43 | 47 | "source": [ |
|
57 | 61 | }, |
58 | 62 | { |
59 | 63 | "cell_type": "code", |
60 | | - "execution_count": 2, |
| 64 | + "execution_count": 3, |
61 | 65 | "metadata": {}, |
62 | 66 | "outputs": [], |
63 | 67 | "source": [ |
64 | 68 | "from langchain_community.chat_models.friendli import ChatFriendli\n", |
65 | 69 | "\n", |
66 | | - "chat = ChatFriendli(model=\"llama-2-13b-chat\", max_tokens=100, temperature=0)" |
| 70 | + "chat = ChatFriendli(model=\"meta-llama-3.1-8b-instruct\", max_tokens=100, temperature=0)" |
67 | 71 | ] |
68 | 72 | }, |
69 | 73 | { |
|
84 | 88 | }, |
85 | 89 | { |
86 | 90 | "cell_type": "code", |
87 | | - "execution_count": 3, |
| 91 | + "execution_count": 4, |
88 | 92 | "metadata": {}, |
89 | 93 | "outputs": [ |
90 | 94 | { |
91 | 95 | "data": { |
92 | 96 | "text/plain": [ |
93 | | - "AIMessage(content=\" Knock, knock!\\nWho's there?\\nCows go.\\nCows go who?\\nMOO!\")" |
| 97 | + "AIMessage(content=\"Why don't eggs tell jokes? They'd crack each other up.\", additional_kwargs={}, response_metadata={}, id='run-d47c1056-54e8-4ea9-ad63-07cf74b834b7-0')" |
94 | 98 | ] |
95 | 99 | }, |
96 | | - "execution_count": 3, |
| 100 | + "execution_count": 4, |
97 | 101 | "metadata": {}, |
98 | 102 | "output_type": "execute_result" |
99 | 103 | } |
|
111 | 115 | }, |
112 | 116 | { |
113 | 117 | "cell_type": "code", |
114 | | - "execution_count": 4, |
| 118 | + "execution_count": 5, |
115 | 119 | "metadata": {}, |
116 | 120 | "outputs": [ |
117 | 121 | { |
118 | 122 | "data": { |
119 | 123 | "text/plain": [ |
120 | | - "[AIMessage(content=\" Knock, knock!\\nWho's there?\\nCows go.\\nCows go who?\\nMOO!\"),\n", |
121 | | - " AIMessage(content=\" Knock, knock!\\nWho's there?\\nCows go.\\nCows go who?\\nMOO!\")]" |
| 124 | + "[AIMessage(content=\"Why don't eggs tell jokes? They'd crack each other up.\", additional_kwargs={}, response_metadata={}, id='run-36775b84-2a7a-48f0-8c68-df23ffffe4b2-0'),\n", |
| 125 | + " AIMessage(content=\"Why don't eggs tell jokes? They'd crack each other up.\", additional_kwargs={}, response_metadata={}, id='run-b204be41-bc06-4d3a-9f74-e66ab1e60e4f-0')]" |
122 | 126 | ] |
123 | 127 | }, |
124 | | - "execution_count": 4, |
| 128 | + "execution_count": 5, |
125 | 129 | "metadata": {}, |
126 | 130 | "output_type": "execute_result" |
127 | 131 | } |
|
132 | 136 | }, |
133 | 137 | { |
134 | 138 | "cell_type": "code", |
135 | | - "execution_count": 5, |
| 139 | + "execution_count": 6, |
136 | 140 | "metadata": {}, |
137 | 141 | "outputs": [ |
138 | 142 | { |
139 | 143 | "data": { |
140 | 144 | "text/plain": [ |
141 | | - "LLMResult(generations=[[ChatGeneration(text=\" Knock, knock!\\nWho's there?\\nCows go.\\nCows go who?\\nMOO!\", message=AIMessage(content=\" Knock, knock!\\nWho's there?\\nCows go.\\nCows go who?\\nMOO!\"))], [ChatGeneration(text=\" Knock, knock!\\nWho's there?\\nCows go.\\nCows go who?\\nMOO!\", message=AIMessage(content=\" Knock, knock!\\nWho's there?\\nCows go.\\nCows go who?\\nMOO!\"))]], llm_output={}, run=[RunInfo(run_id=UUID('a0c2d733-6971-4ae7-beea-653856f4e57c')), RunInfo(run_id=UUID('f3d35e44-ac9a-459a-9e4b-b8e3a73a91e1'))])" |
| 145 | + "LLMResult(generations=[[ChatGeneration(text=\"Why don't eggs tell jokes? They'd crack each other up.\", message=AIMessage(content=\"Why don't eggs tell jokes? They'd crack each other up.\", additional_kwargs={}, response_metadata={}, id='run-2e4cb949-8c51-40d5-92a0-cd0ac577db83-0'))], [ChatGeneration(text=\"Why don't eggs tell jokes? They'd crack each other up.\", message=AIMessage(content=\"Why don't eggs tell jokes? They'd crack each other up.\", additional_kwargs={}, response_metadata={}, id='run-afcdd1be-463c-4e50-9731-7a9f5958e396-0'))]], llm_output={}, run=[RunInfo(run_id=UUID('2e4cb949-8c51-40d5-92a0-cd0ac577db83')), RunInfo(run_id=UUID('afcdd1be-463c-4e50-9731-7a9f5958e396'))], type='LLMResult')" |
142 | 146 | ] |
143 | 147 | }, |
144 | | - "execution_count": 5, |
| 148 | + "execution_count": 6, |
145 | 149 | "metadata": {}, |
146 | 150 | "output_type": "execute_result" |
147 | 151 | } |
|
152 | 156 | }, |
153 | 157 | { |
154 | 158 | "cell_type": "code", |
155 | | - "execution_count": 6, |
| 159 | + "execution_count": 8, |
156 | 160 | "metadata": {}, |
157 | 161 | "outputs": [ |
158 | 162 | { |
159 | 163 | "name": "stdout", |
160 | 164 | "output_type": "stream", |
161 | 165 | "text": [ |
162 | | - " Knock, knock!\n", |
163 | | - "Who's there?\n", |
164 | | - "Cows go.\n", |
165 | | - "Cows go who?\n", |
166 | | - "MOO!" |
| 166 | + "Why don't eggs tell jokes? They'd crack each other up." |
167 | 167 | ] |
168 | 168 | } |
169 | 169 | ], |
|
181 | 181 | }, |
182 | 182 | { |
183 | 183 | "cell_type": "code", |
184 | | - "execution_count": 7, |
| 184 | + "execution_count": 9, |
185 | 185 | "metadata": {}, |
186 | 186 | "outputs": [ |
187 | 187 | { |
188 | 188 | "data": { |
189 | 189 | "text/plain": [ |
190 | | - "AIMessage(content=\" Knock, knock!\\nWho's there?\\nCows go.\\nCows go who?\\nMOO!\")" |
| 190 | + "AIMessage(content=\"Why don't eggs tell jokes? They'd crack each other up.\", additional_kwargs={}, response_metadata={}, id='run-ba8062fb-68af-47b8-bd7b-d1e01b914744-0')" |
191 | 191 | ] |
192 | 192 | }, |
193 | | - "execution_count": 7, |
| 193 | + "execution_count": 9, |
194 | 194 | "metadata": {}, |
195 | 195 | "output_type": "execute_result" |
196 | 196 | } |
|
201 | 201 | }, |
202 | 202 | { |
203 | 203 | "cell_type": "code", |
204 | | - "execution_count": 8, |
| 204 | + "execution_count": 10, |
205 | 205 | "metadata": {}, |
206 | 206 | "outputs": [ |
207 | 207 | { |
208 | 208 | "data": { |
209 | 209 | "text/plain": [ |
210 | | - "[AIMessage(content=\" Knock, knock!\\nWho's there?\\nCows go.\\nCows go who?\\nMOO!\"),\n", |
211 | | - " AIMessage(content=\" Knock, knock!\\nWho's there?\\nCows go.\\nCows go who?\\nMOO!\")]" |
| 210 | + "[AIMessage(content=\"Why don't eggs tell jokes? They'd crack each other up.\", additional_kwargs={}, response_metadata={}, id='run-5d2c77ab-2637-45da-8bbe-1b1f18a22369-0'),\n", |
| 211 | + " AIMessage(content=\"Why don't eggs tell jokes? They'd crack each other up.\", additional_kwargs={}, response_metadata={}, id='run-f1338470-8b52-4d6e-9428-a694a08ae484-0')]" |
212 | 212 | ] |
213 | 213 | }, |
214 | | - "execution_count": 8, |
| 214 | + "execution_count": 10, |
215 | 215 | "metadata": {}, |
216 | 216 | "output_type": "execute_result" |
217 | 217 | } |
|
222 | 222 | }, |
223 | 223 | { |
224 | 224 | "cell_type": "code", |
225 | | - "execution_count": 9, |
| 225 | + "execution_count": 11, |
226 | 226 | "metadata": {}, |
227 | 227 | "outputs": [ |
228 | 228 | { |
229 | 229 | "data": { |
230 | 230 | "text/plain": [ |
231 | | - "LLMResult(generations=[[ChatGeneration(text=\" Knock, knock!\\nWho's there?\\nCows go.\\nCows go who?\\nMOO!\", message=AIMessage(content=\" Knock, knock!\\nWho's there?\\nCows go.\\nCows go who?\\nMOO!\"))], [ChatGeneration(text=\" Knock, knock!\\nWho's there?\\nCows go.\\nCows go who?\\nMOO!\", message=AIMessage(content=\" Knock, knock!\\nWho's there?\\nCows go.\\nCows go who?\\nMOO!\"))]], llm_output={}, run=[RunInfo(run_id=UUID('f2255321-2d8e-41cc-adbd-3f4facec7573')), RunInfo(run_id=UUID('fcc297d0-6ca9-48cb-9d86-e6f78cade8ee'))])" |
| 231 | + "LLMResult(generations=[[ChatGeneration(text=\"Why don't eggs tell jokes? They'd crack each other up.\", message=AIMessage(content=\"Why don't eggs tell jokes? They'd crack each other up.\", additional_kwargs={}, response_metadata={}, id='run-d4e44569-39cc-40cc-93fc-de53e599fd51-0'))], [ChatGeneration(text=\"Why don't eggs tell jokes? They'd crack each other up.\", message=AIMessage(content=\"Why don't eggs tell jokes? They'd crack each other up.\", additional_kwargs={}, response_metadata={}, id='run-54647cc2-bee3-4154-ad00-2e547993e6d7-0'))]], llm_output={}, run=[RunInfo(run_id=UUID('d4e44569-39cc-40cc-93fc-de53e599fd51')), RunInfo(run_id=UUID('54647cc2-bee3-4154-ad00-2e547993e6d7'))], type='LLMResult')" |
232 | 232 | ] |
233 | 233 | }, |
234 | | - "execution_count": 9, |
| 234 | + "execution_count": 11, |
235 | 235 | "metadata": {}, |
236 | 236 | "output_type": "execute_result" |
237 | 237 | } |
|
242 | 242 | }, |
243 | 243 | { |
244 | 244 | "cell_type": "code", |
245 | | - "execution_count": 10, |
| 245 | + "execution_count": 12, |
246 | 246 | "metadata": {}, |
247 | 247 | "outputs": [ |
248 | 248 | { |
249 | 249 | "name": "stdout", |
250 | 250 | "output_type": "stream", |
251 | 251 | "text": [ |
252 | | - " Knock, knock!\n", |
253 | | - "Who's there?\n", |
254 | | - "Cows go.\n", |
255 | | - "Cows go who?\n", |
256 | | - "MOO!" |
| 252 | + "Why don't eggs tell jokes? They'd crack each other up." |
257 | 253 | ] |
258 | 254 | } |
259 | 255 | ], |
|
265 | 261 | ], |
266 | 262 | "metadata": { |
267 | 263 | "kernelspec": { |
268 | | - "display_name": "langchain", |
| 264 | + "display_name": ".venv", |
269 | 265 | "language": "python", |
270 | 266 | "name": "python3" |
271 | 267 | }, |
|
279 | 275 | "name": "python", |
280 | 276 | "nbconvert_exporter": "python", |
281 | 277 | "pygments_lexer": "ipython3", |
282 | | - "version": "3.11.7" |
| 278 | + "version": "3.12.2" |
283 | 279 | } |
284 | 280 | }, |
285 | 281 | "nbformat": 4, |
|
0 commit comments