MCPcopy
hub / github.com/p-e-w/heretic / is_hf_path

Function is_hf_path

src/heretic/utils.py:189–198  ·  view source on GitHub ↗

Checks whether a path likely refers to a Hugging Face repository.

(path: str)

Source from the content-addressed store, hash-verified

187
188
189def is_hf_path(path: str) -> bool:
190 """Checks whether a path likely refers to a Hugging Face repository."""
191
192 # Match Transformers: Existing local paths take precedence over Hub lookup,
193 # even if the path string is also a valid repository ID.
194 if Path(path).exists():
195 return False
196
197 validate_repo_id(path)
198 return True
199
200
201@dataclass

Callers 3

load_promptsFunction · 0.85
get_readme_introFunction · 0.85
runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected