Skip to content

Commit 45cac74

Browse files
authored
fix telemetry place in janus notebook (#2746)
1 parent b8fd093 commit 45cac74

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

notebooks/janus-multimodal-generation/janus-multimodal-generation.ipynb

+6-6
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,7 @@
7171
" if not Path(util_path).exists():\n",
7272
" r = requests.get(base_local_files_url + util_path)\n",
7373
" with open(util_path, \"w\") as f:\n",
74-
" f.write(r.text)\n",
75-
"\n",
76-
"# Read more about telemetry collection at https://github.com/openvinotoolkit/openvino_notebooks?tab=readme-ov-file#-telemetry\n",
77-
"from notebook_utils import collect_telemetry\n",
78-
"\n",
79-
"collect_telemetry(\"janus-multimodal-generation.ipynb\")"
74+
" f.write(r.text)"
8075
]
8176
},
8277
{
@@ -208,6 +203,11 @@
208203
"from ov_janus_helper import convert_janus_model\n",
209204
"import ipywidgets as widgets\n",
210205
"\n",
206+
"# Read more about telemetry collection at https://github.com/openvinotoolkit/openvino_notebooks?tab=readme-ov-file#-telemetry\n",
207+
"from notebook_utils import collect_telemetry\n",
208+
"\n",
209+
"collect_telemetry(\"janus-multimodal-generation.ipynb\")\n",
210+
"\n",
211211
"model_ids = [\"deepseek-ai/Janus-Pro-1B\", \"deepseek-ai/Janus-Pro-7B\", \"deepseek-ai/Janus-1.3B\"]\n",
212212
"\n",
213213
"compression_configuration = {\n",

notebooks/janus-multimodal-generation/ov_janus_helper.py

+2
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,8 @@ def forward_wrap(
323323
for output, output_name in zip(ov_model.outputs, output_names):
324324
output.get_tensor().set_names({output_name})
325325
patch_stateful(ov_model)
326+
ov_model.set_rt_info("f16", ["runtime_options", "KV_CACHE_PRECISION"])
327+
326328
print("✅ Language model successfully converted")
327329

328330
if quantization_config is not None:

notebooks/multimodal-rag/multimodal-rag-llamaindex.ipynb

+7-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,13 @@
390390
"asr_model = OVModelForSpeechSeq2Seq.from_pretrained(asr_model_path, device=asr_device.value)\n",
391391
"asr_processor = AutoProcessor.from_pretrained(asr_model_path)\n",
392392
"\n",
393-
"pipe = pipeline(\"automatic-speech-recognition\", model=asr_model, tokenizer=asr_processor.tokenizer, feature_extractor=asr_processor.feature_extractor, device=torch.device(\"cpu\"))"
393+
"pipe = pipeline(\n",
394+
" \"automatic-speech-recognition\",\n",
395+
" model=asr_model,\n",
396+
" tokenizer=asr_processor.tokenizer,\n",
397+
" feature_extractor=asr_processor.feature_extractor,\n",
398+
" device=torch.device(\"cpu\"),\n",
399+
")"
394400
]
395401
},
396402
{

0 commit comments

Comments
 (0)