MCPcopy Create free account
hub / github.com/MinishLab/vicinity / load

Method load

vicinity/backends/basic.py:133–142  ·  view source on GitHub ↗

Load the vectors from a path.

(cls, path: Path)

Source from the content-addressed store, hash-verified

131
132 @classmethod
133 def load(cls, path: Path) -> BasicBackend:
134 """Load the vectors from a path."""
135 arguments = BasicArgs.load(path / "arguments.json")
136 vectors = cls._load_vectors(path)
137 if arguments.metric == Metric.COSINE:
138 return CosineBasicBackend(vectors, arguments)
139 elif arguments.metric == Metric.EUCLIDEAN:
140 return EuclideanBasicBackend(vectors, arguments)
141 else:
142 raise ValueError(f"Unsupported metric: {arguments.metric}")
143
144 def save(self, path: Path) -> None:
145 """Save the vectors to a path."""

Callers 1

_load_vectorsMethod · 0.45

Calls 3

CosineBasicBackendClass · 0.85
_load_vectorsMethod · 0.80

Tested by

no test coverage detected