MCPcopy Create free account
hub / github.com/LiteSSLHub/DisCo / cached_path

Function cached_path

src/pytorch_pretrained_bert/file_utils.py:74–101  ·  view source on GitHub ↗

Given something that might be a URL (or might be a local path), determine which. If it's a URL, download the file and cache it, and return the path to the cached file. If it's already a local path, make sure the file exists and then return the path.

(url_or_filename: Union[str, Path], cache_dir: Union[str, Path] = None)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 2

from_pretrainedMethod · 0.85
from_pretrainedMethod · 0.85

Calls 1

get_from_cacheFunction · 0.85

Tested by

no test coverage detected