|
104 | 104 | "source": [
|
105 | 105 | "from cmd_helper import clone_repo\n",
|
106 | 106 | "\n",
|
107 |
| - "clone_repo(\"https://github.com/QwenLM/Qwen-Agent.git\")\n", |
| 107 | + "clone_repo(\"https://github.com/QwenLM/Qwen-Agent.git\", revision=\"v0.0.18\")\n", |
108 | 108 | "\n",
|
109 | 109 | "%pip install -q -e ./Qwen-Agent/\"[gui]\""
|
110 | 110 | ]
|
|
139 | 139 | },
|
140 | 140 | {
|
141 | 141 | "cell_type": "code",
|
142 |
| - "execution_count": 4, |
| 142 | + "execution_count": 3, |
143 | 143 | "id": "e8bfe609-1823-4df7-9a68-f210a58a0d38",
|
144 | 144 | "metadata": {},
|
145 | 145 | "outputs": [],
|
|
170 | 170 | },
|
171 | 171 | {
|
172 | 172 | "cell_type": "code",
|
173 |
| - "execution_count": 5, |
| 173 | + "execution_count": 4, |
174 | 174 | "id": "5ea4ce13",
|
175 | 175 | "metadata": {},
|
176 | 176 | "outputs": [],
|
|
213 | 213 | },
|
214 | 214 | {
|
215 | 215 | "cell_type": "code",
|
216 |
| - "execution_count": 6, |
| 216 | + "execution_count": 5, |
217 | 217 | "id": "981df8fe-cfcf-455a-919e-dda36f3b5dfb",
|
218 | 218 | "metadata": {
|
219 | 219 | "test_replace": {
|
|
229 | 229 | "model_path = \"Qwen2-7B-Instruct-ov\"\n",
|
230 | 230 | "\n",
|
231 | 231 | "if not Path(model_path).exists():\n",
|
232 |
| - " optimum_cli(model_id, model_path, additional_args={\"task\": \"text-generation-with-past\", \"trust-remote-code\": \"\", \"weight-format\": \"int4\", \"ratio\": \"0.72\"})" |
| 232 | + " optimum_cli(model_id, model_path, additional_args={\"task\": \"text-generation-with-past\", \"weight-format\": \"int4\", \"ratio\": \"0.72\"})" |
233 | 233 | ]
|
234 | 234 | },
|
235 | 235 | {
|
|
245 | 245 | },
|
246 | 246 | {
|
247 | 247 | "cell_type": "code",
|
248 |
| - "execution_count": null, |
| 248 | + "execution_count": 6, |
249 | 249 | "id": "a1ea3bdb-f97c-4374-880a-2b62abb5baaa",
|
250 | 250 | "metadata": {},
|
251 |
| - "outputs": [], |
| 251 | + "outputs": [ |
| 252 | + { |
| 253 | + "data": { |
| 254 | + "application/vnd.jupyter.widget-view+json": { |
| 255 | + "model_id": "c513d790b90e4783a8a6222bc90bd1d1", |
| 256 | + "version_major": 2, |
| 257 | + "version_minor": 0 |
| 258 | + }, |
| 259 | + "text/plain": [ |
| 260 | + "Dropdown(description='Device:', options=('CPU', 'AUTO'), value='CPU')" |
| 261 | + ] |
| 262 | + }, |
| 263 | + "execution_count": 6, |
| 264 | + "metadata": {}, |
| 265 | + "output_type": "execute_result" |
| 266 | + } |
| 267 | + ], |
252 | 268 | "source": [
|
253 | 269 | "from notebook_utils import device_widget\n",
|
254 | 270 | "\n",
|
|
307 | 323 | },
|
308 | 324 | {
|
309 | 325 | "cell_type": "code",
|
310 |
| - "execution_count": 6, |
| 326 | + "execution_count": 8, |
311 | 327 | "id": "ee406254",
|
312 | 328 | "metadata": {},
|
313 | 329 | "outputs": [],
|
|
359 | 375 | },
|
360 | 376 | {
|
361 | 377 | "cell_type": "code",
|
362 |
| - "execution_count": 7, |
| 378 | + "execution_count": 9, |
363 | 379 | "id": "4799540b-eee0-491f-a5b6-5bae68c22af9",
|
364 | 380 | "metadata": {},
|
365 | 381 | "outputs": [
|
|
377 | 393 | "# User question:\n",
|
378 | 394 | "[{'role': 'user', 'content': \"What's the weather like in San Francisco?\"}]\n",
|
379 | 395 | "# Assistant Response 1:\n",
|
380 |
| - "[{'role': 'assistant', 'content': '', 'function_call': {'name': 'get_current_weather', 'arguments': '{\"location\": \"San Francisco, CA\"}'}}]\n", |
| 396 | + "\n", |
| 397 | + "[{'role': 'assistant', 'content': '', 'function_call': {'name': 'get_current_weather', 'arguments': '{\"location\": \"San Francisco, CA\", \"unit\": \"fahrenheit\"}'}}]\n", |
381 | 398 | "# Function Response:\n",
|
382 | 399 | "{\"location\": \"San Francisco\", \"temperature\": \"72\", \"unit\": \"fahrenheit\"}\n",
|
383 | 400 | "# Assistant Response 2:\n",
|
384 |
| - "[{'role': 'assistant', 'content': 'The current weather in San Francisco is 72 degrees Fahrenheit.'}]\n" |
| 401 | + "\n", |
| 402 | + "[{'role': 'assistant', 'content': 'The weather in San Francisco is currently 72°F (21°C).'}]\n" |
385 | 403 | ]
|
386 | 404 | }
|
387 | 405 | ],
|
|
473 | 491 | },
|
474 | 492 | {
|
475 | 493 | "cell_type": "code",
|
476 |
| - "execution_count": 8, |
| 494 | + "execution_count": 10, |
477 | 495 | "id": "1f64b67c-1259-4fe6-bfc3-af317bfe04f6",
|
478 | 496 | "metadata": {},
|
479 | 497 | "outputs": [],
|
|
537 | 555 | },
|
538 | 556 | {
|
539 | 557 | "cell_type": "code",
|
540 |
| - "execution_count": 9, |
| 558 | + "execution_count": 11, |
541 | 559 | "id": "ea649d2f-ab4b-4228-8f32-75b01a98d9a7",
|
542 | 560 | "metadata": {},
|
543 | 561 | "outputs": [],
|
|
566 | 584 | },
|
567 | 585 | {
|
568 | 586 | "cell_type": "code",
|
569 |
| - "execution_count": 10, |
| 587 | + "execution_count": 12, |
570 | 588 | "id": "52aed08c-b515-40b5-b371-16e27fb89e60",
|
571 | 589 | "metadata": {},
|
572 | 590 | "outputs": [],
|
|
578 | 596 | },
|
579 | 597 | {
|
580 | 598 | "cell_type": "code",
|
581 |
| - "execution_count": null, |
| 599 | + "execution_count": 13, |
582 | 600 | "id": "752e052d-74d7-4df7-81eb-bbf317196ab1",
|
583 | 601 | "metadata": {},
|
584 |
| - "outputs": [], |
| 602 | + "outputs": [ |
| 603 | + { |
| 604 | + "name": "stdout", |
| 605 | + "output_type": "stream", |
| 606 | + "text": [ |
| 607 | + "* Running on local URL: http://127.0.0.1:7860\n", |
| 608 | + "\n", |
| 609 | + "To create a public link, set `share=True` in `launch()`.\n" |
| 610 | + ] |
| 611 | + }, |
| 612 | + { |
| 613 | + "data": { |
| 614 | + "text/html": [ |
| 615 | + "<div><iframe src=\"http://127.0.0.1:7860/\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>" |
| 616 | + ], |
| 617 | + "text/plain": [ |
| 618 | + "<IPython.core.display.HTML object>" |
| 619 | + ] |
| 620 | + }, |
| 621 | + "metadata": {}, |
| 622 | + "output_type": "display_data" |
| 623 | + } |
| 624 | + ], |
585 | 625 | "source": [
|
586 | 626 | "if not Path(\"gradio_helper.py\").exists():\n",
|
587 | 627 | " r = requests.get(url=\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/notebooks/llm-agent-functioncall/gradio_helper.py\")\n",
|
|
617 | 657 | "name": "python",
|
618 | 658 | "nbconvert_exporter": "python",
|
619 | 659 | "pygments_lexer": "ipython3",
|
620 |
| - "version": "3.10.7" |
| 660 | + "version": "3.11.4" |
621 | 661 | },
|
622 | 662 | "openvino_notebooks": {
|
623 | 663 | "imageUrl": "https://github.com/openvinotoolkit/openvino_notebooks/assets/91237924/202cddac-dbbb-493b-ae79-0d45798f75c1",
|
|
0 commit comments