Skip to content

Commit

Permalink
fix skip installation
Browse files Browse the repository at this point in the history
  • Loading branch information
eaidova committed Sep 10, 2024
1 parent 95e56b1 commit 342944c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 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
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 342944c

Please sign in to comment.