|
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(\n", |
| 70 | + " \"torch>=2.1\",\n", |
| 71 | + " \"torchaudio\",\n", |
| 72 | + " \"einops\",\n", |
| 73 | + " \"transformers>=4.46.1\",\n", |
| 74 | + " \"loguru\",\n", |
| 75 | + " \"inflect\",\n", |
| 76 | + " \"pesq\",\n", |
| 77 | + " \"torchcrepe\",\n", |
| 78 | + " \"natsort\",\n", |
| 79 | + " \"polars\",\n", |
| 80 | + " \"uroman\",\n", |
| 81 | + " \"mecab-python3\",\n", |
| 82 | + " \"unidic-lite\",\n", |
| 83 | + " \"--extra-index-url\",\n", |
| 84 | + " \"https://download.pytorch.org/whl/cpu\",\n", |
| 85 | + ")\n", |
| 86 | + "pip_install(\"gradio>=4.19\", \"openvino>=2024.4.0\", \"tqdm\", \"pyyaml\", \"librosa\", \"soundfile\")\n", |
| 87 | + "pip_install(\"git+https://github.com/huggingface/optimum-intel.git\", \"--extra-index-url\", \"https://download.pytorch.org/whl/cpu\")\n", |
58 | 88 | "\n",
|
59 | 89 | "if platform.system() == \"Darwin\":\n",
|
60 |
| - " %pip install -q \"numpy<2.0.0\"" |
| 90 | + " pip_install(\"numpy<2.0.0\")" |
61 | 91 | ]
|
62 | 92 | },
|
63 | 93 | {
|
|
69 | 99 | "import requests\n",
|
70 | 100 | "from pathlib import Path\n",
|
71 | 101 | "\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 | 102 | "\n",
|
82 | 103 | "helper_files = [\"gradio_helper.py\", \"ov_outetts_helper.py\"]\n",
|
83 | 104 | "base_helper_url = \"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/notebooks/outetts-text-to-speech\"\n",
|
|
0 commit comments