From 97c3f848f131e6114be668069fbd25d14f492290 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 29 Sep 2024 15:21:38 +0200 Subject: [PATCH] Add missing import and tqdm improvement Add missing import for `datasets` and rewrite `zip` loops to properly show relative progress using `tqdm`. --- .../examples/colpali-benchmark-vqa-vlm_Vespa-cloud.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/sphinx/source/examples/colpali-benchmark-vqa-vlm_Vespa-cloud.ipynb b/docs/sphinx/source/examples/colpali-benchmark-vqa-vlm_Vespa-cloud.ipynb index 8e901b87..608726f7 100644 --- a/docs/sphinx/source/examples/colpali-benchmark-vqa-vlm_Vespa-cloud.ipynb +++ b/docs/sphinx/source/examples/colpali-benchmark-vqa-vlm_Vespa-cloud.ipynb @@ -37,7 +37,7 @@ }, "outputs": [], "source": [ - "!pip3 install colpali-engine==0.2.2 pyvespa vespacli requests numpy scipy ir_measures pillow" + "!pip3 install colpali-engine==0.2.2 pyvespa vespacli requests numpy scipy ir_measures pillow datasets" ] }, { @@ -948,7 +948,7 @@ "profiles = [\"float-float\", \"float-binary\", \"binary-binary\", \"phased\"]\n", "results = {profile: [] for profile in profiles}\n", "async with app.asyncio(connections=3) as session:\n", - " for row, embedding in tqdm(zip(ds, query_embeddings)):\n", + " for row, embedding in zip(tqdm(ds), query_embeddings):\n", " qrels.append(Qrel(row['questionId'], str(row['docId']), 1))\n", " for profile in profiles:\n", " scored_docs = await get_vespa_response(embedding, row['questionId'], session, profile=profile)\n", @@ -1007,7 +1007,7 @@ "source": [ "results = {profile: [] for profile in [\"phased-rerank-count=5\", \"phased-rerank-count=10\", \"phased-rerank-count=20\", \"phased-rerank-count=40\"]}\n", "async with app.asyncio(connections=3) as session:\n", - " for row, embedding in tqdm(zip(ds, query_embeddings)):\n", + " for row, embedding in zip(tqdm(ds), query_embeddings):\n", " qrels.append(Qrel(row['questionId'], str(row['docId']), 1))\n", " for count in [5, 10, 20, 40]:\n", " scored_docs = await get_vespa_response(embedding, row['questionId'], session, profile=\"phased\", depth=count)\n",