Upload zeroentropy_zerank-2_0.txt with huggingface_hub
Browse files- zeroentropy_zerank-2_0.txt +37 -0
zeroentropy_zerank-2_0.txt
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
```CODE:
|
| 2 |
+
from sentence_transformers import CrossEncoder
|
| 3 |
+
|
| 4 |
+
model = CrossEncoder("zeroentropy/zerank-2")
|
| 5 |
+
|
| 6 |
+
query = "Which planet is known as the Red Planet?"
|
| 7 |
+
passages = [
|
| 8 |
+
"Venus is often called Earth's twin because of its similar size and proximity.",
|
| 9 |
+
"Mars, known for its reddish appearance, is often referred to as the Red Planet.",
|
| 10 |
+
"Jupiter, the largest planet in our solar system, has a prominent red spot.",
|
| 11 |
+
"Saturn, famous for its rings, is sometimes mistaken for the Red Planet."
|
| 12 |
+
]
|
| 13 |
+
|
| 14 |
+
scores = model.predict([(query, passage) for passage in passages])
|
| 15 |
+
print(scores)
|
| 16 |
+
```
|
| 17 |
+
|
| 18 |
+
ERROR:
|
| 19 |
+
Traceback (most recent call last):
|
| 20 |
+
File "/tmp/zeroentropy_zerank-2_0125S1o.py", line 35, in <module>
|
| 21 |
+
scores = model.predict([(query, passage) for passage in passages])
|
| 22 |
+
File "/tmp/.cache/uv/environments-v2/9b0ab42fca7675f2/lib/python3.13/site-packages/torch/utils/_contextlib.py", line 120, in decorate_context
|
| 23 |
+
return func(*args, **kwargs)
|
| 24 |
+
File "/tmp/.cache/uv/environments-v2/9b0ab42fca7675f2/lib/python3.13/site-packages/sentence_transformers/cross_encoder/util.py", line 68, in wrapper
|
| 25 |
+
return func(self, *args, **kwargs)
|
| 26 |
+
File "/tmp/.cache/uv/environments-v2/9b0ab42fca7675f2/lib/python3.13/site-packages/sentence_transformers/cross_encoder/CrossEncoder.py", line 465, in predict
|
| 27 |
+
model_predictions = self.model(**features, return_dict=True)
|
| 28 |
+
File "/tmp/.cache/uv/environments-v2/9b0ab42fca7675f2/lib/python3.13/site-packages/torch/nn/modules/module.py", line 1775, in _wrapped_call_impl
|
| 29 |
+
return self._call_impl(*args, **kwargs)
|
| 30 |
+
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
|
| 31 |
+
File "/tmp/.cache/uv/environments-v2/9b0ab42fca7675f2/lib/python3.13/site-packages/torch/nn/modules/module.py", line 1786, in _call_impl
|
| 32 |
+
return forward_call(*args, **kwargs)
|
| 33 |
+
File "/tmp/.cache/uv/environments-v2/9b0ab42fca7675f2/lib/python3.13/site-packages/transformers/utils/generic.py", line 918, in wrapper
|
| 34 |
+
output = func(self, *args, **kwargs)
|
| 35 |
+
File "/tmp/.cache/uv/environments-v2/9b0ab42fca7675f2/lib/python3.13/site-packages/transformers/modeling_layers.py", line 142, in forward
|
| 36 |
+
raise ValueError("Cannot handle batch sizes > 1 if no padding token is defined.")
|
| 37 |
+
ValueError: Cannot handle batch sizes > 1 if no padding token is defined.
|