Skip to content

Commit 734a84b

Browse files
Fix packages (#2774)
CVS-163049 Fix dependencies in llava-multimodal-chatbot-genai.ipynb Add logging exception from subprocess --------- Co-authored-by: Ekaterina Aidova <ekaterina.aidova@intel.com>
1 parent 8578bac commit 734a84b

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

notebooks/llava-multimodal-chatbot/llava-multimodal-chatbot-genai.ipynb

+4-4
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@
9797
"from pathlib import Path\n",
9898
"import requests\n",
9999
"\n",
100-
"%pip install -q \"torch>=2.3.0\" \"torchvision\" \"torchaudio\" --index-url https://download.pytorch.org/whl/cpu\n",
101-
"%pip install -q \"git+https://github.com/huggingface/optimum-intel.git\" --index-url https://download.pytorch.org/whl/cpu\n",
102-
"%pip install -q \"nncf>=2.14.0\" \"sentencepiece\" \"tokenizers>=0.12.1\" \"transformers>=4.45.0\" \"gradio>=4.36\"\n",
103-
"%pip install -q -U \"openvino-tokenizers>=2024.5.0\" \"openvino>=2024.5.0\" \"openvino-genai>=2024.5.0\"|\n",
100+
"%pip install \"torch>=2.3.0\" \"torchvision\" \"torchaudio\" --extra-index-url https://download.pytorch.org/whl/cpu\n",
101+
"%pip install \"git+https://github.com/huggingface/optimum-intel.git\" --extra-index-url https://download.pytorch.org/whl/cpu\n",
102+
"%pip install \"nncf>=2.14.0\" \"sentencepiece\" \"tokenizers>=0.12.1\" \"transformers>=4.45.0\" \"gradio>=4.36\"\n",
103+
"%pip install -U \"openvino-tokenizers>=2024.5.0\" \"openvino>=2024.5.0\" \"openvino-genai>=2024.5.0\"\n",
104104
"\n",
105105
"\n",
106106
"utility_files = [\"notebook_utils.py\", \"cmd_helper.py\"]\n",

utils/cmd_helper.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import logging
12
import subprocess # nosec - disable B404:import-subprocess check
23
import sys
34
from pathlib import Path
@@ -37,4 +38,9 @@ def optimum_cli(model_id, output_dir, show_command=True, additional_args: Dict[s
3738
display(Markdown("**Export command:**"))
3839
display(Markdown(f"`{export_command}`"))
3940

40-
subprocess.run(export_command.split(" "), shell=(platform.system() == "Windows"), check=True)
41+
try:
42+
subprocess.run(export_command.split(" "), shell=(platform.system() == "Windows"), check=True, capture_output=True)
43+
except subprocess.CalledProcessError as exc:
44+
logger = logging.getLogger()
45+
logger.exception(exc.stderr)
46+
raise exc

0 commit comments

Comments
 (0)