From 14feb123b8aac094b7afcc0e142a91efcca39a1f Mon Sep 17 00:00:00 2001 From: Wey Gu Date: Sat, 20 Jan 2024 13:15:48 +0800 Subject: [PATCH] use different model cache than default --- src/nebulagraph_lite/nebulagraph.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/nebulagraph_lite/nebulagraph.py b/src/nebulagraph_lite/nebulagraph.py index 5acd140..3ff97d5 100644 --- a/src/nebulagraph_lite/nebulagraph.py +++ b/src/nebulagraph_lite/nebulagraph.py @@ -140,11 +140,17 @@ def _try_download_modelscope(self): try: from modelscope.hub.file_download import model_file_download + # create cache folder + cache_path = f"{self.base_path}/cache" + os.makedirs(cache_path, exist_ok=True) + os.environ["MODELSCOPE_CACHE"] = cache_path + # download nebulagraph_lite image tarball model_file = model_file_download( model_id=MODELSCOPE_MODEL_ID, file_path=MODELSCOPE_MODEL_FILE_PATH, revision=MODELSCOPE_MODEL_VERSION, + target_path=self.base_path, ) # download udocker tarball tarball_file = model_file_download(