From 327abd9e386d96cf9196f4a504cdbb05a1a2f321 Mon Sep 17 00:00:00 2001 From: Sarvesh Date: Tue, 9 Jun 2026 15:51:45 +0530 Subject: [PATCH] Configure Step 8 to loop through and display all 6 qualitative examples --- demo.ipynb | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/demo.ipynb b/demo.ipynb index b4bf063..afb4b1d 100644 --- a/demo.ipynb +++ b/demo.ipynb @@ -12,11 +12,11 @@ "\n", "All model architectures, helper functions, and dependencies are defined directly within this notebook so it can run independently of the main repository codebase.\n", "\n", - "### 🔗 Project Resources\n", - "- [**🌐 Project Website**](https://video2lora.github.io/)\n", - "- [**📄 arXiv Paper**](https://arxiv.org/abs/2606.04351)\n", - "- [**🤗 Hugging Face Checkpoints**](https://huggingface.co/MananSuri27/Video2LoRA-SmolVLM-ckpts)\n", - "- [**💻 GitHub Repository**](https://github.com/MananSuri27/video2lora)" + "### \ud83d\udd17 Project Resources\n", + "- [**\ud83c\udf10 Project Website**](https://video2lora.github.io/)\n", + "- [**\ud83d\udcc4 arXiv Paper**](https://arxiv.org/abs/2606.04351)\n", + "- [**\ud83e\udd17 Hugging Face Checkpoints**](https://huggingface.co/MananSuri27/Video2LoRA-SmolVLM-ckpts)\n", + "- [**\ud83d\udcbb GitHub Repository**](https://github.com/MananSuri27/video2lora)" ] }, { @@ -601,15 +601,23 @@ " \"\"\"\n", " display(HTML(html_content))\n", "\n", - "# Display the comparison dashboard dynamically for our completed example!\n", - "display_comparison(\n", - " video_path=examples[1][\"video_path\"],\n", - " question_prompt=examples[1][\"prompt\"],\n", - " ground_truth=examples[1][\"target_text\"],\n", - " base_model_output=base_prediction,\n", - " video2lora_output=video2lora_prediction,\n", - " dataset_name=examples[1][\"dataset\"]\n", - ")" + "# Loop through all 6 qualitative examples, run internalization + inference, and display the dashboards\n", + "print(\"Processing and running qualitative comparison inference for all 6 examples...\")\n", + "for idx, example in enumerate(examples):\n", + " print(f\"\\n--- Running Example {idx+1}/{len(examples)}: {example['id']} ---\")\n", + " # 1. Internalize\n", + " loras = run_internalization(example, model, raw_model, processor, train_args, device)\n", + " # 2. Run inference\n", + " base_pred, v2l_pred = run_inference(example, loras, model, raw_model, processor, tokenizer, train_args, device)\n", + " # 3. Render dashboard\n", + " display_comparison(\n", + " video_path=example[\"video_path\"],\n", + " question_prompt=example[\"prompt\"],\n", + " ground_truth=example[\"target_text\"],\n", + " base_model_output=base_pred,\n", + " video2lora_output=v2l_pred,\n", + " dataset_name=example[\"dataset\"]\n", + " )" ] } ], @@ -634,4 +642,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file