|
56 | 56 | "source": [
|
57 | 57 | "import platform\n",
|
58 | 58 | "import requests\n",
|
| 59 | + "from pathlib import Path\n", |
59 | 60 | "\n",
|
60 | 61 | "\n",
|
61 | 62 | "%pip install -q \"git+https://github.com/huggingface/optimum-intel.git\"\n",
|
|
65 | 66 | "if platform.system() == \"Darwin\":\n",
|
66 | 67 | " %pip install -q \"numpy<2.0.0\"\n",
|
67 | 68 | "\n",
|
68 |
| - "r = requests.get(\n", |
69 |
| - " url=\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/utils/notebook_utils.py\",\n", |
70 |
| - ")\n", |
71 |
| - "open(\"notebook_utils.py\", \"w\").write(r.text)\n", |
72 | 69 | "\n",
|
73 |
| - "r = requests.get(\n", |
74 |
| - " url=\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/utils/cmd_helper.py\",\n", |
75 |
| - ")\n", |
76 |
| - "open(\"cmd_helper.py\", \"w\").write(r.text)" |
| 70 | + "if not Path(\"notebook_utils.py\").exists():\n", |
| 71 | + " r = requests.get(\n", |
| 72 | + " url=\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/utils/notebook_utils.py\",\n", |
| 73 | + " )\n", |
| 74 | + " open(\"notebook_utils.py\", \"w\").write(r.text)\n", |
| 75 | + "\n", |
| 76 | + "\n", |
| 77 | + "if not Path(\"cmd_helper.py\").exists():\n", |
| 78 | + " r = requests.get(\n", |
| 79 | + " url=\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/utils/cmd_helper.py\",\n", |
| 80 | + " )\n", |
| 81 | + " open(\"cmd_helper.py\", \"w\").write(r.text)" |
77 | 82 | ]
|
78 | 83 | },
|
79 | 84 | {
|
|
357 | 362 | "[back to top ⬆️](#Table-of-contents:)"
|
358 | 363 | ]
|
359 | 364 | },
|
| 365 | + { |
| 366 | + "cell_type": "code", |
| 367 | + "execution_count": null, |
| 368 | + "id": "175ad576", |
| 369 | + "metadata": {}, |
| 370 | + "outputs": [], |
| 371 | + "source": [ |
| 372 | + "if not Path(\"gradio_helper.py\").exists():\n", |
| 373 | + " r = requests.get(\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/notebooks/text-to-image-genai/gradio_helper.py\")\n", |
| 374 | + " with open(\"gradio_helper.py\", \"w\") as f:\n", |
| 375 | + " f.write(r.text)" |
| 376 | + ] |
| 377 | + }, |
360 | 378 | {
|
361 | 379 | "cell_type": "code",
|
362 | 380 | "execution_count": null,
|
|
402 | 420 | "tags": {
|
403 | 421 | "categories": [
|
404 | 422 | "Model Demos",
|
405 |
| - "AI Trends" |
| 423 | + "AI Trends", |
| 424 | + "API Overview" |
406 | 425 | ],
|
407 | 426 | "libraries": [],
|
408 | 427 | "other": [
|
|
0 commit comments