|
51 | 51 | "outputs": [],
|
52 | 52 | "source": [
|
53 | 53 | "import platform\n",
|
| 54 | + "import requests\n", |
| 55 | + "from pathlib import Path\n", |
| 56 | + "\n", |
| 57 | + "utility_files = [\"cmd_helper.py\", \"notebook_utils.py\", \"pip_helper.py\"]\n", |
| 58 | + "base_utility_url = \"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/utils/\"\n", |
| 59 | + "\n", |
| 60 | + "for utility_file in utility_files:\n", |
| 61 | + " if not Path(utility_file).exists():\n", |
| 62 | + " r = requests.get(base_utility_url + utility_file)\n", |
| 63 | + " with Path(utility_file).open(\"w\") as f:\n", |
| 64 | + " f.write(r.text)\n", |
54 | 65 | "\n",
|
55 |
| - "%pip install -q \"torch>=2.1\" \"torchaudio\" \"einops\" \"transformers>=4.46.1\" \"loguru\" \"inflect\" \"pesq\" \"torchcrepe\" \"natsort\" \"polars\" uroman mecab-python3 unidic-lite --extra-index-url https://download.pytorch.org/whl/cpu\n", |
56 |
| - "%pip install -q \"gradio>=4.19\" \"openvino>=2024.4.0\" \"tqdm\" \"pyyaml\" \"librosa\" \"soundfile\"\n", |
57 |
| - "%pip install -q \"git+https://github.com/huggingface/optimum-intel.git\" --extra-index-url https://download.pytorch.org/whl/cpu\n", |
| 66 | + "\n", |
| 67 | + "from pip_helper import pip_install\n", |
| 68 | + "\n", |
| 69 | + "pip_install(\"torch>=2.1\", \"torchaudio\", \"einops\", \"transformers>=4.46.1\", \"loguru\", \"inflect\", \"pesq\", \"torchcrepe\",\n", |
| 70 | + " \"natsort\" \"polars\" \"uroman\", \"mecab-python3\" \"unidic-lite\", \"--extra-index-url\", \"https://download.pytorch.org/whl/cpu\")\n", |
| 71 | + "pip_install(\"gradio>=4.19\", \"openvino>=2024.4.0\", \"tqdm\", \"pyyaml\", \"librosa\", \"soundfile\")\n", |
| 72 | + "pip_install(\"git+https://github.com/huggingface/optimum-intel.git\", \"--extra-index-url\", \"https://download.pytorch.org/whl/cpu\")\n", |
58 | 73 | "\n",
|
59 | 74 | "if platform.system() == \"Darwin\":\n",
|
60 |
| - " %pip install -q \"numpy<2.0.0\"" |
| 75 | + " pip_install(\"numpy<2.0.0\")" |
61 | 76 | ]
|
62 | 77 | },
|
63 | 78 | {
|
|
69 | 84 | "import requests\n",
|
70 | 85 | "from pathlib import Path\n",
|
71 | 86 | "\n",
|
72 |
| - "utility_files = [\"cmd_helper.py\", \"notebook_utils.py\"]\n", |
73 |
| - "base_utility_url = \"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/utils/\"\n", |
74 |
| - "\n", |
75 |
| - "for utility_file in utility_files:\n", |
76 |
| - " if not Path(utility_file).exists():\n", |
77 |
| - " r = requests.get(base_utility_url + utility_file)\n", |
78 |
| - " with Path(utility_file).open(\"w\") as f:\n", |
79 |
| - " f.write(r.text)\n", |
80 |
| - "\n", |
81 | 87 | "\n",
|
82 | 88 | "helper_files = [\"gradio_helper.py\", \"ov_outetts_helper.py\"]\n",
|
83 | 89 | "base_helper_url = \"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/notebooks/outetts-text-to-speech\"\n",
|
|
0 commit comments