Skip to content

Commit 8d67a3e

Browse files
Adding Google Colab support - stage 1 (openvinotoolkit#1114)
* 221 runs in colab Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * 221 readme badges Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * 223 colab support Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * 223 add badge Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * 305 colab support Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * 116 support colab Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * 111 colab support Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * global readme update Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * 230 colab support Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * 230 ixes Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * 227 colab support Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * 232 colab support Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * 107 colab support Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * flake fixes yolo Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * 227 fix whisper installation instead of `python setup.py develop` now use `pip install .` Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * 230 flake8 Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * 227 add link to colab Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * 230 fetch utils instead of repo Nuber of samples for validation is limited. Video inference is now the default Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * fix openvino and nncf versions Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * isolate utils imports Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * fix notebook utils import Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * update readmes with installation instruction Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * 230 remove redundant code Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> * update colab links Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com> --------- Signed-off-by: igor-davidyuk <igor.davidyuk@intel.com>
1 parent 0a1197a commit 8d67a3e

File tree

20 files changed

+659
-340
lines changed

20 files changed

+659
-340
lines changed

README.md

+12-12
Large diffs are not rendered by default.

notebooks/107-speech-recognition-quantization/107-speech-recognition-quantization-data2vec.ipynb

+87-59
Large diffs are not rendered by default.

notebooks/107-speech-recognition-quantization/README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Quantize Speech Recognition Models using NNCF PTQ API
1+
# Quantize Speech Recognition Models using NNCF PTQ API
2+
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/107-speech-recognition-quantization/107-speech-recognition-quantization-data2vec.ipynb)
23

34
This tutorial demonstrates how to apply `INT8` quantization to the speech recognition models,
45
using post-training quantization with [NNCF](https://docs.openvino.ai/2022.3/nncf_ptq_introduction.html) (Neural Network Compression Framework).
@@ -22,4 +23,6 @@ The tutorial consists of the following steps:
2223

2324
## Installation Instructions
2425

25-
If you have not installed all required dependencies, follow the [Installation Guide](../../README.md).
26+
This is a self-contained example that relies solely on its own code.</br>
27+
We recommend running the notebook in a virtual environment. You only need a Jupyter server to start.
28+
For details, please refer to [Installation Guide](../../README.md).

notebooks/111-yolov5-quantization-migration/111-yolov5-quantization-migration.ipynb

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"cells": [
33
{
4+
"attachments": {},
45
"cell_type": "markdown",
56
"id": "af86d01b",
67
"metadata": {
@@ -23,6 +24,7 @@
2324
]
2425
},
2526
{
27+
"attachments": {},
2628
"cell_type": "markdown",
2729
"id": "4cdf8008",
2830
"metadata": {
@@ -51,7 +53,8 @@
5153
}
5254
],
5355
"source": [
54-
"!pip install -q psutil \"seaborn>=0.11.0\""
56+
"!pip install -q 'openvino-dev>=2023.0.0' 'nncf>=2.5.0'\n",
57+
"!pip install -q psutil \"seaborn>=0.11.0\" matplotlib numpy onnx"
5558
]
5659
},
5760
{
@@ -90,6 +93,7 @@
9093
]
9194
},
9295
{
96+
"attachments": {},
9397
"cell_type": "markdown",
9498
"id": "527d85d8-2cc9-4073-a3d8-1c2f6872ee2f",
9599
"metadata": {},
@@ -174,6 +178,7 @@
174178
]
175179
},
176180
{
181+
"attachments": {},
177182
"cell_type": "markdown",
178183
"id": "cfc9a783",
179184
"metadata": {},
@@ -220,6 +225,7 @@
220225
]
221226
},
222227
{
228+
"attachments": {},
223229
"cell_type": "markdown",
224230
"id": "37b80fe4",
225231
"metadata": {},
@@ -241,6 +247,7 @@
241247
]
242248
},
243249
{
250+
"attachments": {},
244251
"cell_type": "markdown",
245252
"id": "2b33033e",
246253
"metadata": {
@@ -293,6 +300,7 @@
293300
]
294301
},
295302
{
303+
"attachments": {},
296304
"cell_type": "markdown",
297305
"id": "3f412b85",
298306
"metadata": {},
@@ -394,6 +402,7 @@
394402
]
395403
},
396404
{
405+
"attachments": {},
397406
"cell_type": "markdown",
398407
"id": "48134d13",
399408
"metadata": {},
@@ -439,6 +448,7 @@
439448
]
440449
},
441450
{
451+
"attachments": {},
442452
"cell_type": "markdown",
443453
"id": "0c501bce",
444454
"metadata": {},
@@ -480,6 +490,7 @@
480490
]
481491
},
482492
{
493+
"attachments": {},
483494
"cell_type": "markdown",
484495
"id": "ec8ab84c",
485496
"metadata": {},
@@ -509,6 +520,7 @@
509520
]
510521
},
511522
{
523+
"attachments": {},
512524
"cell_type": "markdown",
513525
"id": "77bc9011",
514526
"metadata": {},
@@ -532,6 +544,7 @@
532544
]
533545
},
534546
{
547+
"attachments": {},
535548
"cell_type": "markdown",
536549
"id": "6cdb6920",
537550
"metadata": {},
@@ -561,6 +574,7 @@
561574
]
562575
},
563576
{
577+
"attachments": {},
564578
"cell_type": "markdown",
565579
"id": "e8a2908e-00c8-4a94-8b83-3dd6b36dc29b",
566580
"metadata": {},
@@ -589,6 +603,7 @@
589603
]
590604
},
591605
{
606+
"attachments": {},
592607
"cell_type": "markdown",
593608
"id": "ba241f41",
594609
"metadata": {},
@@ -799,6 +814,7 @@
799814
]
800815
},
801816
{
817+
"attachments": {},
802818
"cell_type": "markdown",
803819
"id": "998f20b3",
804820
"metadata": {},
@@ -869,6 +885,7 @@
869885
]
870886
},
871887
{
888+
"attachments": {},
872889
"cell_type": "markdown",
873890
"id": "2b8de873",
874891
"metadata": {
@@ -1068,6 +1085,7 @@
10681085
]
10691086
},
10701087
{
1088+
"attachments": {},
10711089
"cell_type": "markdown",
10721090
"id": "9c5dcbc4",
10731091
"metadata": {},
@@ -1418,6 +1436,7 @@
14181436
]
14191437
},
14201438
{
1439+
"attachments": {},
14211440
"cell_type": "markdown",
14221441
"id": "d8ed2610",
14231442
"metadata": {},

notebooks/111-yolov5-quantization-migration/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Migrate quantization from POT API to NNCF API
2+
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/111-yolov5-quantization-migration/111-yolov5-quantization-migration.ipynb)
23

34
![Ultralytics Yolov5 results](https://user-images.githubusercontent.com/44352144/177097174-cfe78939-e946-445e-9fce-d8897417ef8e.png)
45

@@ -20,4 +21,6 @@ The tutorial consists from the following parts:
2021

2122
## Installation Instructions
2223

23-
If you have not installed all required dependencies, follow the [Installation Guide](../../README.md).
24+
This is a self-contained example that relies solely on its own code.</br>
25+
We recommend running the notebook in a virtual environment. You only need a Jupyter server to start.
26+
For details, please refer to [Installation Guide](../../README.md).

notebooks/116-sparsity-optimization/116-sparsity-optimization.ipynb

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
]
2020
},
2121
{
22+
"attachments": {},
2223
"cell_type": "markdown",
2324
"id": "7bef22e9",
2425
"metadata": {},
@@ -35,10 +36,12 @@
3536
},
3637
"outputs": [],
3738
"source": [
39+
"!pip install -q 'openvino-dev>=2023.0.0'\n",
3840
"!pip install -q \"git+https://github.com/huggingface/optimum-intel.git\" datasets onnx onnxruntime"
3941
]
4042
},
4143
{
44+
"attachments": {},
4245
"cell_type": "markdown",
4346
"id": "4d6b41e6-132b-40da-b3b9-91bacba29e31",
4447
"metadata": {},
@@ -181,6 +184,7 @@
181184
]
182185
},
183186
{
187+
"attachments": {},
184188
"cell_type": "markdown",
185189
"id": "f9151b11",
186190
"metadata": {},
@@ -232,6 +236,7 @@
232236
]
233237
},
234238
{
239+
"attachments": {},
235240
"cell_type": "markdown",
236241
"id": "cc1d4d61",
237242
"metadata": {},

notebooks/116-sparsity-optimization/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Accelerate Inference of Sparse Transformer Models with OpenVINO™ and 4th Gen Intel&reg; Xeon&reg; Scalable Processors
2+
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/116-sparsity-optimization/116-sparsity-optimization.ipynb)
23

34
This tutorial demonstrates how to improve performance of sparse Transformer models with [OpenVINO](https://docs.openvino.ai/) on 4th Gen Intel&reg; Xeon&reg; Scalable processors. It uses a pre-trained model from the [Hugging Face Transformers](https://huggingface.co/docs/transformers/index) library and shows how to convert it to the OpenVINO™ IR format and run inference on a CPU, using a dedicated runtime option that enables sparsity optimizations. It also demonstrates how to get more performance stacking sparsity with 8-bit quantization. To simplify the user experience, the [Hugging Face Optimum](https://huggingface.co/docs/optimum) library is used to convert the model to the OpenVINO™ IR format and quantize it using [Neural Network Compression Framework](https://github.com/openvinotoolkit/nncf).
45

@@ -13,4 +14,6 @@ The tutorial consists of the following steps:
1314

1415
## Installation Instructions
1516

16-
If you have not installed all required dependencies, follow the [Installation Guide](../../README.md).
17+
This is a self-contained example that relies solely on its own code.</br>
18+
We recommend running the notebook in a virtual environment. You only need a Jupyter server to start.
19+
For details, please refer to [Installation Guide](../../README.md).

notebooks/221-machine-translation/221-machine-translation.ipynb

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"cells": [
33
{
4+
"attachments": {},
45
"cell_type": "markdown",
56
"metadata": {},
67
"source": [
@@ -16,6 +17,17 @@
1617
"After the inference, we have a sequence of up to 200 tokens. The structure is the same as the one for the input."
1718
]
1819
},
20+
{
21+
"cell_type": "code",
22+
"execution_count": null,
23+
"metadata": {},
24+
"outputs": [],
25+
"source": [
26+
"# Install requirements\n",
27+
"!pip install -q 'openvino-dev>=2023.0.0'\n",
28+
"!pip install -q tokenizers"
29+
]
30+
},
1931
{
2032
"cell_type": "code",
2133
"execution_count": null,
@@ -30,6 +42,7 @@
3042
]
3143
},
3244
{
45+
"attachments": {},
3346
"cell_type": "markdown",
3447
"metadata": {
3548
"pycharm": {
@@ -56,6 +69,7 @@
5669
]
5770
},
5871
{
72+
"attachments": {},
5973
"cell_type": "markdown",
6074
"metadata": {
6175
"pycharm": {
@@ -87,6 +101,7 @@
87101
]
88102
},
89103
{
104+
"attachments": {},
90105
"cell_type": "markdown",
91106
"metadata": {
92107
"pycharm": {
@@ -124,6 +139,7 @@
124139
]
125140
},
126141
{
142+
"attachments": {},
127143
"cell_type": "markdown",
128144
"metadata": {
129145
"pycharm": {
@@ -189,6 +205,7 @@
189205
]
190206
},
191207
{
208+
"attachments": {},
192209
"cell_type": "markdown",
193210
"metadata": {},
194211
"source": [
@@ -240,6 +257,7 @@
240257
]
241258
},
242259
{
260+
"attachments": {},
243261
"cell_type": "markdown",
244262
"metadata": {},
245263
"source": [
@@ -278,7 +296,7 @@
278296
"name": "python",
279297
"nbconvert_exporter": "python",
280298
"pygments_lexer": "ipython3",
281-
"version": "3.8.10"
299+
"version": "3.10.6"
282300
}
283301
},
284302
"nbformat": 4,

notebooks/221-machine-translation/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Interactive Machine Translation with OpenVino
22
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/openvinotoolkit/openvino_notebooks/HEAD?labpath=notebooks%2F221-machine-translation%2F221-machine-translation.ipynb)
3+
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/openvino_notebooks/blob/main/notebooks/221-machine-translation/221-machine-translation.ipynb)
34

45
Machine translation is a form of natural language processing that translates sentences from one language to another.
56

@@ -12,4 +13,6 @@ The last cell is interactive, so you can type sentences in English that will be
1213

1314
## Installation Instructions
1415

15-
If you have not installed all required dependencies, follow the [Installation Guide](../../README.md).
16+
This is a self-contained example that relies solely on its own code.</br>
17+
We recommend running the notebook in a virtual environment. You only need a Jupyter server to start.
18+
For details, please refer to [Installation Guide](../../README.md).

0 commit comments

Comments
 (0)