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

Method save_cached_files

modelscope/hub/utils/caching.py:99–107  ·  view source on GitHub ↗

Save cache metadata in order to verify that the cached content is consistent with the remote content. Example of the cached content: [{'Path': 'configuration.json', 'Revision': 'f01dxxx'}, {'Path': 'model.bin', 'Revision': '1159xxx'}, ...]

(self)

Source from the content-addressed store, hash-verified

97 raise
98
99 def save_cached_files(self):
100 """
101 Save cache metadata in order to verify that the cached content is consistent with the remote content.
102
103 Example of the cached content:
104 [{'Path': 'configuration.json', 'Revision': 'f01dxxx'}, {'Path': 'model.bin', 'Revision': '1159xxx'}, ...]
105 """
106 with self._cache_lock:
107 self._save_cached_files_unlocked()
108
109 def get_file(self, key):
110 """Check the key is in the cache, if exist, return the file, otherwise return None.

Callers 1

remove_keyMethod · 0.95

Calls 1

Tested by

no test coverage detected