Spaces:
Runtime error
Runtime error
Commit
·
8f9e28d
1
Parent(s):
4069faf
update: decouple Byaldi from pyproject.toml because of conflict with adapters and mentioned the same in relevant docs as well
Browse files
medrag_multi_modal/retrieval/colpali_retrieval.py
CHANGED
|
@@ -19,6 +19,14 @@ class CalPaliRetriever(weave.Model):
|
|
| 19 |
also provides methods to index new data and to predict/retrieve documents based on a query.
|
| 20 |
|
| 21 |
!!! example "Indexing Data"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
```python
|
| 23 |
import wandb
|
| 24 |
from medrag_multi_modal.retrieval import CalPaliRetriever
|
|
@@ -33,6 +41,14 @@ class CalPaliRetriever(weave.Model):
|
|
| 33 |
```
|
| 34 |
|
| 35 |
!!! example "Retrieving Documents"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
```python
|
| 37 |
import weave
|
| 38 |
|
|
|
|
| 19 |
also provides methods to index new data and to predict/retrieve documents based on a query.
|
| 20 |
|
| 21 |
!!! example "Indexing Data"
|
| 22 |
+
First you need to install `Byaldi` library by Answer.ai.
|
| 23 |
+
|
| 24 |
+
```bash
|
| 25 |
+
uv pip install Byaldi>=0.0.5
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
Next, you can index the data by running the following code:
|
| 29 |
+
|
| 30 |
```python
|
| 31 |
import wandb
|
| 32 |
from medrag_multi_modal.retrieval import CalPaliRetriever
|
|
|
|
| 41 |
```
|
| 42 |
|
| 43 |
!!! example "Retrieving Documents"
|
| 44 |
+
First you need to install `Byaldi` library by Answer.ai.
|
| 45 |
+
|
| 46 |
+
```bash
|
| 47 |
+
uv pip install Byaldi>=0.0.5
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
Next, you can retrieve the documents by running the following code:
|
| 51 |
+
|
| 52 |
```python
|
| 53 |
import weave
|
| 54 |
|
pyproject.toml
CHANGED
|
@@ -5,8 +5,8 @@ description = ""
|
|
| 5 |
readme = "README.md"
|
| 6 |
requires-python = ">=3.10"
|
| 7 |
dependencies = [
|
|
|
|
| 8 |
"bm25s[full]>=0.2.2",
|
| 9 |
-
"Byaldi>=0.0.5",
|
| 10 |
"firerequests>=0.0.7",
|
| 11 |
"jax[cpu]>=0.4.34",
|
| 12 |
"pdf2image>=1.17.0",
|
|
@@ -38,8 +38,8 @@ dependencies = [
|
|
| 38 |
|
| 39 |
[project.optional-dependencies]
|
| 40 |
core = [
|
|
|
|
| 41 |
"bm25s[full]>=0.2.2",
|
| 42 |
-
"Byaldi>=0.0.5",
|
| 43 |
"firerequests>=0.0.7",
|
| 44 |
"jax[cpu]>=0.4.34",
|
| 45 |
"marker-pdf>=0.2.17",
|
|
@@ -55,12 +55,8 @@ core = [
|
|
| 55 |
"weave>=0.51.14",
|
| 56 |
]
|
| 57 |
|
| 58 |
-
dev = [
|
| 59 |
-
|
| 60 |
-
"isort>=5.13.2",
|
| 61 |
-
"black>=24.10.0",
|
| 62 |
-
"ruff>=0.6.9",
|
| 63 |
-
]
|
| 64 |
|
| 65 |
docs = [
|
| 66 |
"mkdocs>=1.6.1",
|
|
|
|
| 5 |
readme = "README.md"
|
| 6 |
requires-python = ">=3.10"
|
| 7 |
dependencies = [
|
| 8 |
+
"adapters>=1.0.0",
|
| 9 |
"bm25s[full]>=0.2.2",
|
|
|
|
| 10 |
"firerequests>=0.0.7",
|
| 11 |
"jax[cpu]>=0.4.34",
|
| 12 |
"pdf2image>=1.17.0",
|
|
|
|
| 38 |
|
| 39 |
[project.optional-dependencies]
|
| 40 |
core = [
|
| 41 |
+
"adapters>=1.0.0",
|
| 42 |
"bm25s[full]>=0.2.2",
|
|
|
|
| 43 |
"firerequests>=0.0.7",
|
| 44 |
"jax[cpu]>=0.4.34",
|
| 45 |
"marker-pdf>=0.2.17",
|
|
|
|
| 55 |
"weave>=0.51.14",
|
| 56 |
]
|
| 57 |
|
| 58 |
+
dev = ["pytest>=8.3.3", "isort>=5.13.2", "black>=24.10.0", "ruff>=0.6.9"]
|
| 59 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
docs = [
|
| 62 |
"mkdocs>=1.6.1",
|