MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / huggingface_token

Function huggingface_token

tools/model_manager.py:60–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58}
59
60
61def huggingface_token() -> str | None:
62 token = os.environ.get("HF_TOKEN") or os.environ.get("HUGGING_FACE_HUB_TOKEN")
63 if token:
64 return token.strip()
65 token_path = Path.home() / ".cache" / "huggingface" / "token"
66 if token_path.is_file():
67 cached = token_path.read_text(encoding="utf-8").strip()
68 if cached:
69 return cached
70 return None
71
72

Callers 1

http_headersFunction · 0.85

Calls 2

read_textMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected