Skip to content

Commit

Permalink
migrate on openvino storage for nightly package install (#2059)
Browse files Browse the repository at this point in the history
  • Loading branch information
eaidova authored May 30, 2024
1 parent 4b1137d commit 9814a71
Show file tree
Hide file tree
Showing 12 changed files with 138 additions and 138 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"id": "ef2ed242-3561-464c-8d1c-cc3862e23702",
"metadata": {},
Expand Down Expand Up @@ -32,6 +33,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "f97c435a",
"metadata": {},
Expand Down Expand Up @@ -59,6 +61,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "08aa16b1-d2f6-4a3a-abfb-5ec278133c80",
"metadata": {},
Expand All @@ -77,12 +80,15 @@
"metadata": {},
"outputs": [],
"source": [
"%pip uninstall -q -y openvino openvino-dev openvino-nightly optimum optimum-intel\n",
"%pip install -q \"diffusers>=0.16.1\" \"transformers>=4.33.0\" \"torch>=2.1\" \"openvino-nightly\" \"nncf>=2.10.0\" onnx \"gradio>=4.19\" --extra-index-url https://download.pytorch.org/whl/cpu\n",
"%pip install -Uq pip\n",
"%pip uninstall -q -y optimum optimum-intel\n",
"%pip install --pre -Uq openvino openvino-tokenizers[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly\n",
"%pip install -q \"diffusers>=0.16.1\" \"transformers>=4.33.0\" \"torch>=2.1\" \"nncf>=2.10.0\" onnx \"gradio>=4.19\" --extra-index-url https://download.pytorch.org/whl/cpu\n",
"%pip install -q \"git+https://github.com/huggingface/optimum-intel.git\""
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "e145f4ab-1753-4eec-a369-575a93448462",
"metadata": {
Expand All @@ -104,6 +110,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "a38d7f46-1a27-48ea-9064-170cd6fdeb5f",
"metadata": {},
Expand Down Expand Up @@ -291,6 +298,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "367f84f8-33e8-4ad6-bd40-e6fd41d2d703",
"metadata": {},
Expand Down Expand Up @@ -381,6 +389,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "dbea489f-7ff1-49a1-a14d-5d19fd0abfb2",
"metadata": {},
Expand Down Expand Up @@ -494,6 +503,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "b6d9c4a5-ef75-4076-9f1c-f45a2259ec46",
"metadata": {},
Expand Down Expand Up @@ -536,6 +546,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "b9b5da4d-d2fd-440b-b204-7fbc6966dd1f",
"metadata": {},
Expand All @@ -560,6 +571,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "c58611d6-0a91-4efd-976e-4221acbb43cd",
"metadata": {},
Expand Down Expand Up @@ -599,6 +611,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "27a01739-1363-42ef-927f-6a340bdbe7ba",
"metadata": {},
Expand Down Expand Up @@ -654,6 +667,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "583202d2-6d29-4729-af2e-232d3ee0bc2c",
"metadata": {},
Expand Down Expand Up @@ -731,6 +745,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "562f2dcf-75ef-4554-85e3-e04f486776cc",
"metadata": {},
Expand Down Expand Up @@ -817,6 +832,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "50d918a9-1cbe-49a5-85ad-5e370c8af7f5",
"metadata": {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"id": "a30812de-c46e-44a3-8194-b7f6f0fd4707",
"metadata": {},
Expand Down Expand Up @@ -46,6 +47,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "f9dc9580-da81-47dd-b5d3-3cafa8f5a4b5",
"metadata": {},
Expand All @@ -61,8 +63,8 @@
"metadata": {},
"outputs": [],
"source": [
"%pip uninstall -q -y openvino-dev openvino openvino-nightly\n",
"%pip install -q --upgrade openvino-nightly\n",
"%pip install -Uq pip\n",
"%pip install --pre -Uq openvino --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly\n",
"%pip install -q \"gradio>=4.19\" omegaconf decord einops pytorch_lightning kornia open_clip_torch transformers av opencv-python torch --extra-index-url https://download.pytorch.org/whl/cpu"
]
},
Expand All @@ -87,6 +89,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "a3c0c659-aad3-4962-8db7-7b123379f01a",
"metadata": {},
Expand Down Expand Up @@ -137,6 +140,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "be9643c8-a70c-4dba-8259-d4467ae82949",
"metadata": {},
Expand Down Expand Up @@ -177,6 +181,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "3c63518d-957d-4358-8711-cf6fb935d8be",
"metadata": {},
Expand All @@ -191,19 +196,21 @@
]
},
{
"metadata": {},
"attachments": {},
"cell_type": "markdown",
"id": "d9824415cd5b0ffd",
"metadata": {},
"source": [
"### Convert CLIP text encoder\n",
"[back to top ⬆️](#Table-of-contents:)"
],
"id": "d9824415cd5b0ffd"
]
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"id": "2e0b1637-7757-49bb-b60f-175f7d77b470",
"metadata": {},
"outputs": [],
"source": [
"from dynamicrafter.lvdm.modules.encoders.condition import FrozenOpenCLIPEmbedder\n",
"\n",
Expand All @@ -226,24 +233,25 @@
" COND_STAGE_MODEL_OV_PATH,\n",
" example_input=torch.ones([1, 77], dtype=torch.long),\n",
")"
],
"id": "2e0b1637-7757-49bb-b60f-175f7d77b470"
]
},
{
"metadata": {},
"attachments": {},
"cell_type": "markdown",
"id": "63b361937c948711",
"metadata": {},
"source": [
"### Convert CLIP image encoder\n",
"[back to top ⬆️](#Table-of-contents:)\n",
"`FrozenOpenCLIPImageEmbedderV2` model accepts images of various resolutions."
],
"id": "63b361937c948711"
]
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"id": "c6aa0a3f-4093-44c7-b7b0-ca830abc4826",
"metadata": {},
"outputs": [],
"source": [
"EMBEDDER_OV_PATH = Path(\"models/embedder_ir.xml\")\n",
"\n",
Expand All @@ -252,23 +260,24 @@
"\n",
"model.embedder.model.visual.input_patchnorm = None # fix error: visual model has not attribute 'input_patchnorm'\n",
"convert(model.embedder, EMBEDDER_OV_PATH, example_input=dummy_input, input_shape=[1, 3, -1, -1])"
],
"id": "c6aa0a3f-4093-44c7-b7b0-ca830abc4826"
]
},
{
"metadata": {},
"attachments": {},
"cell_type": "markdown",
"id": "eef65d17fec62fa",
"metadata": {},
"source": [
"### Convert AE encoder\n",
"[back to top ⬆️](#Table-of-contents:)"
],
"id": "eef65d17fec62fa"
]
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"id": "41434d51-07da-4688-b0af-be6271fef54f",
"metadata": {},
"outputs": [],
"source": [
"ENCODER_FIRST_STAGE_OV_PATH = Path(\"models/encode_first_stage_ir.xml\")\n",
"\n",
Expand All @@ -280,23 +289,24 @@
" ENCODER_FIRST_STAGE_OV_PATH,\n",
" example_input=dummy_input,\n",
")"
],
"id": "41434d51-07da-4688-b0af-be6271fef54f"
]
},
{
"metadata": {},
"attachments": {},
"cell_type": "markdown",
"id": "7ec5ee02317d8e77",
"metadata": {},
"source": [
"### Convert Diffusion U-Net model\n",
"[back to top ⬆️](#Table-of-contents:)"
],
"id": "7ec5ee02317d8e77"
]
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"id": "ca501d47-3f65-4d58-804d-d8ed20a761af",
"metadata": {},
"outputs": [],
"source": [
"MODEL_OV_PATH = Path(\"models/model_ir.xml\")\n",
"\n",
Expand All @@ -322,10 +332,10 @@
" \"temporal_length\": torch.tensor([16]),\n",
" },\n",
")"
],
"id": "ca501d47-3f65-4d58-804d-d8ed20a761af"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "8d5430af-12b4-4a15-bb7c-c9300f824431",
"metadata": {},
Expand Down Expand Up @@ -375,6 +385,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "51ff6eb8-dd58-4820-aae3-85c0b4e487a8",
"metadata": {},
Expand Down Expand Up @@ -420,6 +431,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "11f2c95b-e872-458b-a6f8-448f8124ffe6",
"metadata": {},
Expand Down Expand Up @@ -506,6 +518,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "1178a847-eb14-419b-815e-c47628aa6868",
"metadata": {},
Expand All @@ -528,6 +541,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "4417db2b-2f65-407c-a384-ec466f18bca0",
"metadata": {},
Expand Down
5 changes: 3 additions & 2 deletions notebooks/llm-agent-langchain/llm-agent-langchain.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,15 @@
"\n",
"os.environ[\"GIT_CLONE_PROTECTION_ACTIVE\"] = \"false\"\n",
"\n",
"%pip uninstall -q -y openvino-dev openvino openvino-nightly optimum optimum-intel\n",
"%pip install -Uq pip\n",
"%pip uninstall -q -y optimum optimum-intel\n",
"%pip install --pre -Uq openvino openvino-tokenizers[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly\n",
"%pip install -q --extra-index-url https://download.pytorch.org/whl/cpu\\\n",
"\"git+https://github.com/huggingface/optimum-intel.git\"\\\n",
"\"git+https://github.com/openvinotoolkit/nncf.git\"\\\n",
"\"torch>=2.1\"\\\n",
"\"datasets\"\\\n",
"\"accelerate\"\\\n",
"\"openvino-nightly\"\\\n",
"\"gradio\"\\\n",
"\"transformers>=4.38.1\" \"langchain>=0.2.0\" \"langchain-community>=0.2.0\" \"wikipedia\""
]
Expand Down
5 changes: 3 additions & 2 deletions notebooks/llm-chatbot/llm-chatbot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,15 @@
"\n",
"os.environ[\"GIT_CLONE_PROTECTION_ACTIVE\"] = \"false\"\n",
"\n",
"%pip uninstall -q -y openvino-dev openvino openvino-nightly optimum optimum-intel\n",
"%pip install -Uq pip\n",
"%pip uninstall -q -y optimum optimum-intel\n",
"%pip install --pre -Uq openvino openvino-tokenizers[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly\n",
"%pip install -q --extra-index-url https://download.pytorch.org/whl/cpu\\\n",
"\"git+https://github.com/huggingface/optimum-intel.git\"\\\n",
"\"git+https://github.com/openvinotoolkit/nncf.git\"\\\n",
"\"torch>=2.1\"\\\n",
"\"datasets\" \\\n",
"\"accelerate\"\\\n",
"\"openvino-nightly\"\\\n",
"\"gradio>=4.19\"\\\n",
"\"onnx\" \"einops\" \"transformers_stream_generator\" \"tiktoken\" \"transformers>=4.38.1\" \"bitsandbytes\""
]
Expand Down
Loading

0 comments on commit 9814a71

Please sign in to comment.