Skip to content

Commit

Permalink
change the ASR model id
Browse files Browse the repository at this point in the history
change the ASR model id

change the ASR model id

change the ASR model id

change the ASR model id

change the ASR model id

change the ASR model id

change the ASR model id

change the ASR model id
  • Loading branch information
openvino-dev-samples committed Dec 18, 2024
1 parent dfd4aed commit 7290856
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions notebooks/multimodal-rag/multimodal-rag-llamaindex.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@
}
],
"source": [
"%pip uninstall -q -y \"moviepy\" \"decorator\"\n",
"\n",
"%pip install -q \"llama-index-core\" \"llama-index-embeddings-openvino>=0.4.1\" \"llama-index-multi-modal-llms-openvino\" \"llama-index-readers-file\" \\\n",
" \"llama-index-vector-stores-qdrant\" \\\n",
" \"transformers>=4.45\" \\\n",
" \"moviepy==1.0.3\" \\\n",
" \"moviepy>=2.1.1\" \\\n",
" \"librosa\" \\\n",
" \"python-ffmpeg<=1.0.16\" \\\n",
" \"open_clip_torch\" \\\n",
Expand All @@ -82,7 +84,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "f24c553d-8c4c-40dd-86e4-313b99f928d0",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -146,7 +148,7 @@
"source": [
"import huggingface_hub as hf_hub\n",
"\n",
"asr_model_id = \"OpenVINO/distil-large-v3-int8-ov\"\n",
"asr_model_id = \"OpenVINO/distil-whisper-large-v3-int8-ov\"\n",
"asr_model_path = asr_model_id.split(\"/\")[-1]\n",
"\n",
"if not Path(asr_model_path).exists():\n",
Expand Down Expand Up @@ -296,17 +298,17 @@
"outputs": [],
"source": [
"video_url = \"https://github.com/user-attachments/assets/2e38afa5-ce3e-448c-ad1a-0e9471039ff1\"\n",
"output_video_path = \"./video_data/\"\n",
"output_folder = \"./mixed_data/\"\n",
"output_audio_path = \"./mixed_data/output_audio.wav\"\n",
"filepath = \"video_data/input_vid.mp4\"\n",
"\n",
"filepath = output_video_path + \"input_vid.mp4\"\n",
"example_path = Path(filepath)\n",
"example_path.parent.mkdir(parents=True, exist_ok=True)\n",
"Path(output_folder).mkdir(parents=True, exist_ok=True)\n",
"\n",
"if not Path(filepath).exists():\n",
" r = requests.get(video_url)\n",
" with Path(filepath).open(\"wb\") as f:\n",
" f.write(r.content)"
"r = requests.get(video_url)\n",
"with example_path.open(\"wb\") as f:\n",
" f.write(r.content)"
]
},
{
Expand Down Expand Up @@ -442,7 +444,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": null,
"id": "8f45641a",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -875,6 +877,7 @@
" model_id_or_path=vlm_int4_model_path,\n",
" device=vlm_device.value,\n",
" messages_to_prompt=messages_to_prompt,\n",
" trust_remote_code=True,\n",
" generate_kwargs={\"do_sample\": False, \"eos_token_id\": processor.tokenizer.eos_token_id},\n",
")"
]
Expand Down

0 comments on commit 7290856

Please sign in to comment.