Skip to content

Commit 9412abd

Browse files
authored
fix issues in notebooks (#2708)
1 parent 4e57017 commit 9412abd

File tree

5 files changed

+13
-29
lines changed

5 files changed

+13
-29
lines changed

notebooks/depth-anything/depth-anything.ipynb

+6-6
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,7 @@
7575
" r = requests.get(\n",
7676
" url=\"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/utils/notebook_utils.py\",\n",
7777
" )\n",
78-
" open(\"notebook_utils.py\", \"w\").write(r.text)\n",
79-
"\n",
80-
"# Read more about telemetry collection at https://github.com/openvinotoolkit/openvino_notebooks?tab=readme-ov-file#-telemetry\n",
81-
"from notebook_utils import collect_telemetry\n",
82-
"\n",
83-
"collect_telemetry(\"depth-anything.ipynb\")"
78+
" open(\"notebook_utils.py\", \"w\").write(r.text)"
8479
]
8580
},
8681
{
@@ -145,6 +140,11 @@
145140
"source": [
146141
"from pathlib import Path\n",
147142
"\n",
143+
"# Read more about telemetry collection at https://github.com/openvinotoolkit/openvino_notebooks?tab=readme-ov-file#-telemetry\n",
144+
"from notebook_utils import collect_telemetry\n",
145+
"\n",
146+
"collect_telemetry(\"depth-anything.ipynb\")\n",
147+
"\n",
148148
"\n",
149149
"attention_file_path = Path(\"./torchhub/facebookresearch_dinov2_main/dinov2/layers/attention.py\")\n",
150150
"orig_attention_path = attention_file_path.parent / (\"orig_\" + attention_file_path.name)\n",

notebooks/quantizing-model-with-accuracy-control/speech-recognition-quantization-wav2vec2.ipynb

+2-7
Original file line numberDiff line numberDiff line change
@@ -498,16 +498,11 @@
498498
"metadata": {},
499499
"outputs": [],
500500
"source": [
501-
"import ipywidgets as widgets\n",
501+
"from notebook_utils import device_widget\n",
502502
"\n",
503503
"core = ov.Core()\n",
504504
"\n",
505-
"device = widgets.Dropdown(\n",
506-
" options=core.available_devices + [\"AUTO\"],\n",
507-
" value=\"CPU\",\n",
508-
" description=\"Device:\",\n",
509-
" disabled=False,\n",
510-
")\n",
505+
"device = device_widget(\"CPU\")\n",
511506
"\n",
512507
"device"
513508
]

notebooks/rmbg-background-removal/rmbg-background-removal.ipynb

+2-7
Original file line numberDiff line numberDiff line change
@@ -297,16 +297,11 @@
297297
}
298298
],
299299
"source": [
300-
"import ipywidgets as widgets\n",
300+
"from notebook_utils import device_widget\n",
301301
"\n",
302302
"core = ov.Core()\n",
303303
"\n",
304-
"device = widgets.Dropdown(\n",
305-
" options=core.available_devices + [\"AUTO\"],\n",
306-
" value=\"AUTO\",\n",
307-
" description=\"Device:\",\n",
308-
" disabled=False,\n",
309-
")\n",
304+
"device = device_widget()\n",
310305
"\n",
311306
"device"
312307
]

notebooks/sana-image-generation/sana-image-generation.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"\n",
5757
"%pip install -q \"gradio>=4.19\" \"torch>=2.1\" \"transformers\" \"nncf>=2.14.0\" \"diffusers>=0.32.0\" \"opencv-python\" \"pillow\" \"peft>=0.7.0\" --extra-index-url https://download.pytorch.org/whl/cpu\n",
5858
"%pip install -q \"sentencepiece\" \"protobuf\"\n",
59-
"%pip install -q \"git+https://github.com/eaidova/optimum-intel.git\"\n",
59+
"%pip install -q \"git+https://github.com/huggingface/optimum-intel.git\" --extra-index-url https://download.pytorch.org/whl/cpu\n",
6060
"%pip install -qU \"openvino>=2024.6.0\"\n",
6161
"\n",
6262
"if platform.system() == \"Darwin\":\n",

notebooks/sound-generation-audioldm2/sound-generation-audioldm2.ipynb

+2-8
Original file line numberDiff line numberDiff line change
@@ -754,17 +754,11 @@
754754
}
755755
],
756756
"source": [
757-
"import ipywidgets as widgets\n",
757+
"from notebook_utils import device_widget\n",
758758
"\n",
759759
"core = ov.Core()\n",
760760
"\n",
761-
"device = widgets.Dropdown(\n",
762-
" options=core.available_devices + [\"AUTO\"],\n",
763-
" value=\"CPU\",\n",
764-
" description=\"Device:\",\n",
765-
" disabled=False,\n",
766-
")\n",
767-
"\n",
761+
"device = device_widget()\n",
768762
"device"
769763
]
770764
},

0 commit comments

Comments
 (0)