MCPcopy Index your code
hub / github.com/modelscope/modelscope / get_model_cache_dir

Function get_model_cache_dir

modelscope/utils/file_utils.py:96–108  ·  view source on GitHub ↗

cache dir precedence: function parameter > environment > ~/.cache/modelscope/hub/model_id Args: model_id (str, optional): The model id. Returns: str: the model_id dir if model_id not None, otherwise cache root dir.

(model_id: str)

Source from the content-addressed store, hash-verified

94
95
96def get_model_cache_dir(model_id: str) -> str:
97 """cache dir precedence:
98 function parameter > environment > ~/.cache/modelscope/hub/model_id
99
100 Args:
101 model_id (str, optional): The model id.
102
103 Returns:
104 str: the model_id dir if model_id not None, otherwise cache root dir.
105 """
106 root_path = get_model_cache_root()
107 return root_path if model_id is None else os.path.join(
108 root_path, model_id + '/')
109
110
111def read_file(path):

Callers 2

test_singleMethod · 0.90
base_cfg_modify_fnMethod · 0.90

Calls 1

get_model_cache_rootFunction · 0.85

Tested by 2

test_singleMethod · 0.72
base_cfg_modify_fnMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…