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

Method prepare_dir

tests/pipelines/test_base.py:29–40  ·  view source on GitHub ↗
(self, dirname, pipeline_name)

Source from the content-addressed store, hash-verified

27 self.prepare_dir(self.model_dir, 'custom-image')
28
29 def prepare_dir(self, dirname, pipeline_name):
30 if not os.path.exists(dirname):
31 os.makedirs(dirname)
32 cfg_file = os.path.join(dirname, ModelFile.CONFIGURATION)
33 cfg = {
34 ConfigFields.framework: 'dummy',
35 ConfigFields.task: 'dummy-task',
36 ConfigFields.pipeline: {
37 'type': pipeline_name,
38 }
39 }
40 io.dump(cfg, cfg_file)
41
42 def test_abstract(self):
43

Callers 1

setUpMethod · 0.95

Calls 2

existsMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected