MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / main

Function main

scripts/download_embedding_model.py:36–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34
35
36def main() -> int:
37 args = parse_args()
38 dest = Path(args.dest).expanduser()
39 if not dest.is_absolute():
40 dest = (PROJECT_ROOT / dest).resolve()
41
42 dest.parent.mkdir(parents=True, exist_ok=True)
43 token = os.environ.get("HF_TOKEN") or None
44
45 print(f"Downloading {args.model_id} -> {dest}")
46 snapshot_download(
47 repo_id=args.model_id,
48 local_dir=str(dest),
49 token=token,
50 )
51
52 print("")
53 print("Done. Add these lines to .env when you want to use the local snapshot:")
54 print("EMBEDDING_PROVIDER=local")
55 print(f"LOCAL_EMBEDDING_MODEL_PATH={dest}")
56 print("LOCAL_EMBEDDING_TRUST_REMOTE_CODE=true")
57 return 0
58
59
60if __name__ == "__main__":

Callers 1

Calls 2

getMethod · 0.80
parse_argsFunction · 0.70

Tested by

no test coverage detected