Skip to content

Commit

Permalink
fix skip installation (#2372)
Browse files Browse the repository at this point in the history
  • Loading branch information
eaidova authored Sep 10, 2024
1 parent 4426fe9 commit f149b3a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
10 changes: 7 additions & 3 deletions .ci/patch_notebooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,24 @@ def remove_ov_install(cell):
updated_lines = []

def has_additional_deps(str_part):
if "pip_install(" in str_part:
return False
if "%pip" in str_part:
return False
if "install" in str_part:
return False
if str_part.startswith("-"):
if str_part.startswith("-") or str_part.startswith('"-'):
return False
if str_part.startswith("https://") or str_part.startswith('"https://'):
return False
if str_part.startswith("https://"):
if ")" == str_part:
return False
return True

lines = cell["source"].replace("pip_instal(", "pip_install( ").split("\n")
for line in lines:
if "openvino" in line:
if "optimum-cli" in line or line.startswith("#"):
if "optimum-cli" in line or line.startswith("#") or "-openvino" in line:
updated_lines.append(line)
continue
updated_line_content = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"source": [
"%pip install -q \"gradio>=4.19\" \"torch>=2.1\" \"transformers\" \"nncf>=2.12.0\" \"diffusers>=0.30.0\" \"opencv-python\" \"pillow\" \"peft>=0.7.0\" --extra-index-url https://download.pytorch.org/whl/cpu\n",
"%pip install -q \"sentencepiece\" \"protobuf\"\n",
"%pip install -qU --pre \"openvino\" --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly"
"%pip install -qU --pre \"openvino>=2024.4.0\" --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly"
]
},
{
Expand Down
5 changes: 2 additions & 3 deletions notebooks/llm-agent-react/llm-agent-rag-llamaindex.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,8 @@
" \"transformers>=4.43.1\",\n",
")\n",
"pip_install(\"-q\", \"git+https://github.com/huggingface/optimum-intel.git\", \"git+https://github.com/openvinotoolkit/nncf.git\", \"datasets\", \"accelerate\")\n",
"pip_install(\n",
" \"--pre\", \"-Uq\", \"openvino>=2024.2.0\", \"openvino-tokenizers[transformers]\", \"--extra-index-url\", \"https://storage.openvinotoolkit.org/simple/wheels/nightly\"\n",
")"
"pip_install(\"--pre\", \"-Uq\", \"openvino>=2024.2.0\", \"--extra-index-url\", \"https://storage.openvinotoolkit.org/simple/wheels/nightly\")\n",
"pip_install(\"--pre\", \"-Uq\", \"openvino-tokenizers[transformers]\", \"--extra-index-url\", \"https://storage.openvinotoolkit.org/simple/wheels/nightly\")"
]
},
{
Expand Down
5 changes: 2 additions & 3 deletions notebooks/llm-rag-langchain/llm-rag-langchain.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,8 @@
"\n",
"os.environ[\"GIT_CLONE_PROTECTION_ACTIVE\"] = \"false\"\n",
"\n",
"pip_install(\n",
" \"--pre\", \"-Uq\", \"openvino>=2024.2.0\", \"openvino-tokenizers[transformers]\", \"--extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly\"\n",
")\n",
"pip_install(\"--pre\", \"-U\", \"openvino>=2024.2.0\", \"--extra-index-url\", \"https://storage.openvinotoolkit.org/simple/wheels/nightly\")\n",
"pip_install(\"--pre\", \"-U\" \"openvino-tokenizers[transformers]\", \"--extra-index-url\", \"https://storage.openvinotoolkit.org/simple/wheels/nightly\")\n",
"pip_install(\n",
" \"-q\",\n",
" \"--extra-index-url\",\n",
Expand Down
5 changes: 2 additions & 3 deletions notebooks/llm-rag-llamaindex/llm-rag-llamaindex.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,8 @@
" \"llama-index-postprocessor-openvino-rerank>=0.2.0\",\n",
")\n",
"pip_install(\"-q\", \"git+https://github.com/huggingface/optimum-intel.git\", \"git+https://github.com/openvinotoolkit/nncf.git\", \"datasets\", \"accelerate\", \"gradio\")\n",
"pip_install(\n",
" \"--pre\", \"-Uq\", \"openvino>=2024.2.0\", \"openvino-tokenizers[transformers]\", \"--extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly\"\n",
")"
"pip_install(\"--pre\", \"-U\", \"openvino>=2024.2\", \"--extra-index-url\", \"https://storage.openvinotoolkit.org/simple/wheels/nightly\")\n",
"pip_install(\"--pre\", \"-U\", \"openvino-tokenizers[transformers]>=2024.2\", \"--extra-index-url\", \"https://storage.openvinotoolkit.org/simple/wheels/nightly\")"
]
},
{
Expand Down

0 comments on commit f149b3a

Please sign in to comment.