Spaces:
Runtime error
Runtime error
Commit
·
f48b4d7
1
Parent(s):
b82a487
fix: lint
Browse files
medrag_multi_modal/retrieval/contriever_retrieval.py
CHANGED
|
@@ -66,7 +66,7 @@ class ContrieverRetriever(weave.Model):
|
|
| 66 |
resulting vector index. If an index name is provided, the vector index is saved to
|
| 67 |
a file in the safetensors format. Additionally, if a Weave run is active, the vector
|
| 68 |
index file is logged as an artifact to Weave.
|
| 69 |
-
|
| 70 |
!!! example "Example Usage"
|
| 71 |
```python
|
| 72 |
import weave
|
|
@@ -117,7 +117,7 @@ class ContrieverRetriever(weave.Model):
|
|
| 117 |
appropriate device (CPU or GPU). The text chunks are converted into a list of
|
| 118 |
dictionaries. The method then returns an instance of the class initialized with
|
| 119 |
the retrieved model name, vector index, and chunk dataset.
|
| 120 |
-
|
| 121 |
!!! example "Example Usage"
|
| 122 |
```python
|
| 123 |
import weave
|
|
@@ -172,7 +172,7 @@ class ContrieverRetriever(weave.Model):
|
|
| 172 |
the query embedding and the precomputed vector index. The similarity metric can be either
|
| 173 |
cosine similarity or Euclidean distance. The top-k chunks with the highest similarity scores
|
| 174 |
are returned as a list of dictionaries, each containing a chunk and its corresponding score.
|
| 175 |
-
|
| 176 |
!!! example "Example Usage"
|
| 177 |
```python
|
| 178 |
import weave
|
|
|
|
| 66 |
resulting vector index. If an index name is provided, the vector index is saved to
|
| 67 |
a file in the safetensors format. Additionally, if a Weave run is active, the vector
|
| 68 |
index file is logged as an artifact to Weave.
|
| 69 |
+
|
| 70 |
!!! example "Example Usage"
|
| 71 |
```python
|
| 72 |
import weave
|
|
|
|
| 117 |
appropriate device (CPU or GPU). The text chunks are converted into a list of
|
| 118 |
dictionaries. The method then returns an instance of the class initialized with
|
| 119 |
the retrieved model name, vector index, and chunk dataset.
|
| 120 |
+
|
| 121 |
!!! example "Example Usage"
|
| 122 |
```python
|
| 123 |
import weave
|
|
|
|
| 172 |
the query embedding and the precomputed vector index. The similarity metric can be either
|
| 173 |
cosine similarity or Euclidean distance. The top-k chunks with the highest similarity scores
|
| 174 |
are returned as a list of dictionaries, each containing a chunk and its corresponding score.
|
| 175 |
+
|
| 176 |
!!! example "Example Usage"
|
| 177 |
```python
|
| 178 |
import weave
|