Spaces:
Running
Running
fahmiaziz98
commited on
Commit
·
313c5a2
1
Parent(s):
4cf20a7
deleted method _format_values
Browse files- core/embedding.py +2 -6
core/embedding.py
CHANGED
|
@@ -79,10 +79,6 @@ class SparseEmbeddingModel:
|
|
| 79 |
self.model: Optional[SparseEncoder] = None
|
| 80 |
self._loaded = False
|
| 81 |
|
| 82 |
-
def _format_values(self, values: List[float]) -> List[float]:
|
| 83 |
-
"""Format float values to a fixed precision."""
|
| 84 |
-
return [round(float(v), 8) for v in values]
|
| 85 |
-
|
| 86 |
def load(self) -> None:
|
| 87 |
"""Load the sparse embedding model."""
|
| 88 |
if self._loaded:
|
|
@@ -117,7 +113,7 @@ class SparseEmbeddingModel:
|
|
| 117 |
|
| 118 |
return {
|
| 119 |
"indices": indices,
|
| 120 |
-
"values":
|
| 121 |
}
|
| 122 |
|
| 123 |
|
|
@@ -151,7 +147,7 @@ class SparseEmbeddingModel:
|
|
| 151 |
"text": texts[i],
|
| 152 |
"sparse_embedding": {
|
| 153 |
"indices": indices,
|
| 154 |
-
"values":
|
| 155 |
}
|
| 156 |
})
|
| 157 |
|
|
|
|
| 79 |
self.model: Optional[SparseEncoder] = None
|
| 80 |
self._loaded = False
|
| 81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
def load(self) -> None:
|
| 83 |
"""Load the sparse embedding model."""
|
| 84 |
if self._loaded:
|
|
|
|
| 113 |
|
| 114 |
return {
|
| 115 |
"indices": indices,
|
| 116 |
+
"values": values
|
| 117 |
}
|
| 118 |
|
| 119 |
|
|
|
|
| 147 |
"text": texts[i],
|
| 148 |
"sparse_embedding": {
|
| 149 |
"indices": indices,
|
| 150 |
+
"values": values
|
| 151 |
}
|
| 152 |
})
|
| 153 |
|