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

Method load

modelscope/utils/regress_test_utils.py:53–67  ·  view source on GitHub ↗
(self, local, remote)

Source from the content-addressed store, hash-verified

51 shutil.copy(local, os.path.join(path, remote))
52
53 def load(self, local, remote):
54 if self.load_func is not None:
55 self.load_func(local, remote)
56 else:
57 path = os.path.abspath(
58 os.path.join(Path.cwd(), 'data', 'test', 'regression'))
59 baseline = os.path.join(path, remote)
60 if not os.path.exists(baseline):
61 raise ValueError(f'base line file {baseline} not exist')
62 print(
63 f'local file found:{baseline}, md5:{hashlib.md5(open(baseline,"rb").read()).hexdigest()}'
64 )
65 if os.path.exists(local):
66 os.remove(local)
67 os.symlink(baseline, local, target_is_directory=False)
68
69 @contextlib.contextmanager
70 def monitor_module_single_forward(self,

Callers 2

monitor_module_trainMethod · 0.95

Calls 4

printFunction · 0.85
existsMethod · 0.45
readMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected