Skip to content

Commit

Permalink
fix ci issues (#1490)
Browse files Browse the repository at this point in the history
  • Loading branch information
eaidova authored Nov 27, 2023
1 parent 469c5aa commit c9502e8
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 50 deletions.
13 changes: 13 additions & 0 deletions .ci/patch_notebooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ def disable_gradio_debug(nb, notebook_path):
print(f"Disabled gradio debug mode for {notebook_path}")
return nb


def disable_skip_ext(nb, notebook_path):
found = False
for cell in nb["cells"]:
if "%%skip" in cell["source"]:
found = True
cell["source"] = re.sub(r"%%skip.*.\n", "\n", cell["source"])
if found:
print(f"Disabled skip extension mode for {notebook_path}")
return nb


def patch_notebooks(notebooks_dir, test_device=""):
"""
Patch notebooks in notebooks directory with replacement values
Expand Down Expand Up @@ -75,6 +87,7 @@ def patch_notebooks(notebooks_dir, test_device=""):
if not found:
print(f"No replacements found for {notebookfile}")
disable_gradio_debug(nb, notebookfile)
disable_skip_ext(nb, notebookfile)
nb_without_out, _ = output_remover.from_notebook_node(nb)
with notebookfile.with_name(f"test_{notebookfile.name}").open("w", encoding="utf-8") as out_file:
out_file.write(nb_without_out)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"outputs": [],
"source": [
"%pip install -q \"openvino>=2023.1.0\" \"nncf>=2.5.0\"\n",
"%pip install -q \"ultralytics==8.0.43\" onnx --extra-index-url https://download.pytorch.org/whl/cpu"
"%pip install -q \"torch>=2.1\" \"torchvision>=0.16\" \"ultralytics==8.0.43\" onnx --extra-index-url https://download.pytorch.org/whl/cpu"
]
},
{
Expand Down Expand Up @@ -1724,7 +1724,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"metadata": {},
"outputs": [],
"source": [
"%pip install -q \"openvino>=2023.1.0\" \"nncf>=2.5.0\" \"protobuf==3.20.*\" \"ultralytics==8.0.159\" \"onnx\" --extra-index-url https://download.pytorch.org/whl/cpu"
"%pip install -q \"openvino>=2023.1.0\" \"nncf>=2.5.0\" \"protobuf==3.20.*\" \"torch>=2.1\" \"torchvision>=0.16\" \"ultralytics==8.0.159\" \"onnx\" --extra-index-url https://download.pytorch.org/whl/cpu"
]
},
{
Expand Down Expand Up @@ -1711,7 +1711,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"outputs": [],
"source": [
"%pip install -q \"openvino>=2023.1.0\" \"nncf>=2.5.0\"\n",
"%pip install -q \"ultralytics==8.0.43\" onnx --extra-index-url https://download.pytorch.org/whl/cpu"
"%pip install -q \"torch>=2.1\" \"torchvision>=0.16\" \"ultralytics==8.0.43\" onnx --extra-index-url https://download.pytorch.org/whl/cpu"
]
},
{
Expand Down Expand Up @@ -1883,7 +1883,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand Down
7 changes: 3 additions & 4 deletions notebooks/234-encodec-audio-compression/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
librosa>=0.8.1
--extra-index-url https://download.pytorch.org/whl/cpu
torch
torchaudio
encodec;python_version>"3.7"
git+https://git@github.com/eaidova/encodec#egg=encodec;python_version=="3.7"
torch>=2.1
torchaudio>=2.1
encodec
gradio
openvino>=2023.1.0
39 changes: 1 addition & 38 deletions notebooks/237-segment-anything/237-segment-anything.ipynb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"id": "1662bb7c",
"metadata": {},
Expand Down Expand Up @@ -31,7 +30,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "7fcc21a0",
"metadata": {},
Expand Down Expand Up @@ -66,7 +64,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "55ae4e00",
"metadata": {},
Expand All @@ -82,11 +79,10 @@
"metadata": {},
"outputs": [],
"source": [
"%pip install -q \"segment_anything\" \"gradio>=3.25\" \"openvino>=2023.1.0\" \"nncf>=2.5.0\" --extra-index-url https://download.pytorch.org/whl/cpu"
"%pip install -q \"segment_anything\" \"gradio>=3.25\" \"openvino>=2023.1.0\" \"nncf>=2.5.0\" \"torch>=2.1\" \"torchvision>=0.16\" --extra-index-url https://download.pytorch.org/whl/cpu"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "bd0f6b2b",
"metadata": {},
Expand All @@ -96,7 +92,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "5c0e935b-b801-46c4-b69d-b508b07425cd",
"metadata": {},
Expand All @@ -106,7 +101,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "1540f719",
"metadata": {},
Expand Down Expand Up @@ -170,7 +164,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "1249127f-24dc-4b8f-875a-dbd56887c1fc",
"metadata": {},
Expand Down Expand Up @@ -256,7 +249,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "9951b5f0-66a0-46c8-bd5f-486051f6e398",
"metadata": {},
Expand All @@ -268,7 +260,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "c2aec47b-dff7-4189-be5a-d25564061ead",
"metadata": {
Expand Down Expand Up @@ -461,7 +452,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "3352ff4b-ddaa-433e-b19d-d4cff857ce3e",
"metadata": {},
Expand All @@ -471,7 +461,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "927a928b",
"metadata": {},
Expand Down Expand Up @@ -533,7 +522,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "9c8545e4-3031-4c18-997c-59c732da62fc",
"metadata": {},
Expand Down Expand Up @@ -665,7 +653,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "56e1a79b-c54b-4201-b8f9-c85f92473f00",
"metadata": {},
Expand All @@ -692,7 +679,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "bf5a9f55",
"metadata": {},
Expand Down Expand Up @@ -736,7 +722,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "7256394c",
"metadata": {},
Expand All @@ -759,7 +744,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "a99c2cc5",
"metadata": {},
Expand All @@ -784,7 +768,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "4b6409c9",
"metadata": {},
Expand Down Expand Up @@ -833,7 +816,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "1f1d4d15",
"metadata": {},
Expand All @@ -856,7 +838,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "9e3c49cb-beda-4d3f-8706-12b196640448",
"metadata": {},
Expand Down Expand Up @@ -892,7 +873,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "b1823b37",
"metadata": {},
Expand All @@ -914,7 +894,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "d3781955",
"metadata": {},
Expand Down Expand Up @@ -969,7 +948,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "b23bdc35-6dcf-441d-8cf0-614977a7c262",
"metadata": {},
Expand All @@ -978,7 +956,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "2ef211d0",
"metadata": {},
Expand Down Expand Up @@ -1030,7 +1007,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "6e119dcb",
"metadata": {},
Expand All @@ -1055,7 +1031,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "65edabd2",
"metadata": {},
Expand Down Expand Up @@ -1111,7 +1086,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "8f319683-a149-4ee8-8fd3-bf6ca9f44204",
"metadata": {},
Expand Down Expand Up @@ -1232,7 +1206,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "a13e5bdd-49fb-4720-80fa-e0fc8c40c898",
"metadata": {},
Expand Down Expand Up @@ -1499,7 +1472,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "1ef507ce-0ed2-4ed0-8ccb-3c0e2368621f",
"metadata": {},
Expand Down Expand Up @@ -1591,7 +1563,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "c2f1ee93-afde-4a38-95ef-7b891fe63a1e",
"metadata": {
Expand Down Expand Up @@ -1699,7 +1670,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "d69c6468",
"metadata": {},
Expand All @@ -1719,7 +1689,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "f83822e2-e89f-4b97-b1be-b74a2528bab3",
"metadata": {
Expand Down Expand Up @@ -1760,7 +1729,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "f2bc5711-3b74-44f2-b620-4e50935b0a46",
"metadata": {},
Expand Down Expand Up @@ -1795,7 +1763,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "5b8c5022-2de6-4dbe-9029-eff9b1d4555b",
"metadata": {},
Expand Down Expand Up @@ -1836,7 +1803,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "82277f2b-0c54-41ab-9d8b-07dc213b4221",
"metadata": {},
Expand Down Expand Up @@ -1921,7 +1887,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "bb613daf-f1e6-4540-8afa-4cdf18d4c732",
"metadata": {},
Expand Down Expand Up @@ -1981,7 +1946,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "6d803eed-a395-4058-87f0-75e30519526e",
"metadata": {},
Expand Down Expand Up @@ -2031,7 +1995,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "79093fdd-09ea-40d8-b697-2c53861d3a79",
"metadata": {},
Expand Down
Loading

0 comments on commit c9502e8

Please sign in to comment.