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

Method load_from_hub

vicinity/vicinity.py:314–326  ·  view source on GitHub ↗

Load a Vicinity instance from the Hugging Face Hub. :param repo_id: The repository ID on the Hugging Face Hub. :param token: Optional authentication token for private repositories. :param **kwargs: Additional arguments passed to Dataset.load_from_hub(). :ret

(cls: type[Vicinity[Any]], repo_id: str, token: str | None = None, **kwargs: Any)

Source from the content-addressed store, hash-verified

312
313 @classmethod
314 def load_from_hub(cls: type[Vicinity[Any]], repo_id: str, token: str | None = None, **kwargs: Any) -> Vicinity[Any]:
315 """
316 Load a Vicinity instance from the Hugging Face Hub.
317
318 :param repo_id: The repository ID on the Hugging Face Hub.
319 :param token: Optional authentication token for private repositories.
320 :param **kwargs: Additional arguments passed to Dataset.load_from_hub().
321 :return: A Vicinity instance.
322 """
323 from vicinity.integrations.huggingface import load_from_hub
324
325 items, vector_store, backend, config = load_from_hub(repo_id=repo_id, token=token)
326 return Vicinity(items, backend, metadata=config["metadata"], vector_store=vector_store)
327
328 def evaluate(
329 self,

Callers

nothing calls this directly

Calls 2

load_from_hubFunction · 0.90
VicinityClass · 0.85

Tested by

no test coverage detected