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

Method clear_cache

modelscope/hub/utils/caching.py:149–155  ·  view source on GitHub ↗

Remove all files and metadata from the cache In the case of multiple cache locations, this clears only the last one, which is assumed to be the read/write one.

(self)

Source from the content-addressed store, hash-verified

147 return False
148
149 def clear_cache(self):
150 """Remove all files and metadata from the cache
151 In the case of multiple cache locations, this clears only the last one,
152 which is assumed to be the read/write one.
153 """
154 rmtree(self.cache_root_location)
155 self.load_cache()
156
157 def hash_name(self, key):
158 return hashlib.sha256(key.encode()).hexdigest()

Callers 1

clear_llm_infoFunction · 0.45

Calls 1

load_cacheMethod · 0.95

Tested by

no test coverage detected