Skip to content

Commit

Permalink
fix standalone execution text2image genai (#2665)
Browse files Browse the repository at this point in the history
  • Loading branch information
eaidova authored Jan 16, 2025
1 parent 7bc7519 commit 3579c08
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions notebooks/text-to-image-genai/text-to-image-genai.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"source": [
"import platform\n",
"import requests\n",
"from pathlib import Path\n",
"\n",
"\n",
"%pip install -q \"git+https://github.com/huggingface/optimum-intel.git\"\n",
Expand All @@ -65,15 +66,19 @@
"if platform.system() == \"Darwin\":\n",
" %pip install -q \"numpy<2.0.0\"\n",
"\n",
"r = requests.get(\n",
" url=\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/utils/notebook_utils.py\",\n",
")\n",
"open(\"notebook_utils.py\", \"w\").write(r.text)\n",
"\n",
"r = requests.get(\n",
" url=\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/utils/cmd_helper.py\",\n",
")\n",
"open(\"cmd_helper.py\", \"w\").write(r.text)"
"if not Path(\"notebook_utils.py\").exists():\n",
" r = requests.get(\n",
" url=\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/utils/notebook_utils.py\",\n",
" )\n",
" open(\"notebook_utils.py\", \"w\").write(r.text)\n",
"\n",
"\n",
"if not Path(\"cmd_helper.py\").exists():\n",
" r = requests.get(\n",
" url=\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/utils/cmd_helper.py\",\n",
" )\n",
" open(\"cmd_helper.py\", \"w\").write(r.text)"
]
},
{
Expand Down Expand Up @@ -357,6 +362,19 @@
"[back to top ⬆️](#Table-of-contents:)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "175ad576",
"metadata": {},
"outputs": [],
"source": [
"if not Path(\"gradio_helper.py\").exists():\n",
" r = requests.get(\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/notebooks/text-to-image-genai/gradio_helper.py\")\n",
" with open(\"gradio_helper.py\", \"w\") as f:\n",
" f.write(r.text)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -402,7 +420,8 @@
"tags": {
"categories": [
"Model Demos",
"AI Trends"
"AI Trends",
"API Overview"
],
"libraries": [],
"other": [
Expand Down

0 comments on commit 3579c08

Please sign in to comment.