MCPcopy Create free account
hub / github.com/modelscope/modelscope / __init__

Method __init__

modelscope/hub/utils/caching.py:32–47  ·  view source on GitHub ↗

Base file system cache interface. Args: cache_root_location (str): The root location to store files. kwargs(dict): The keyword arguments.

(
        self,
        cache_root_location: str,
        **kwargs,
    )

Source from the content-addressed store, hash-verified

30 """
31
32 def __init__(
33 self,
34 cache_root_location: str,
35 **kwargs,
36 ):
37 """Base file system cache interface.
38
39 Args:
40 cache_root_location (str): The root location to store files.
41 kwargs(dict): The keyword arguments.
42 """
43 self._cache_lock = threading.RLock()
44
45 os.makedirs(cache_root_location, exist_ok=True)
46 self.cache_root_location = cache_root_location
47 self.load_cache()
48
49 def get_root_location(self):
50 return self.cache_root_location

Callers 1

__init__Method · 0.45

Calls 1

load_cacheMethod · 0.95

Tested by

no test coverage detected