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

Method prepare_dir

tests/pipelines/test_builder.py:56–67  ·  view source on GitHub ↗
(self, dirname, pipeline_name)

Source from the content-addressed store, hash-verified

54class PipelineInterfaceTest(unittest.TestCase):
55
56 def prepare_dir(self, dirname, pipeline_name):
57 if not os.path.exists(dirname):
58 os.makedirs(dirname)
59 cfg_file = os.path.join(dirname, ModelFile.CONFIGURATION)
60 cfg = {
61 ConfigFields.framework: Frameworks.torch,
62 ConfigFields.task: Tasks.image_classification,
63 ConfigFields.pipeline: {
64 'type': pipeline_name,
65 }
66 }
67 io.dump(cfg, cfg_file)
68
69 def setUp(self) -> None:
70 self.prepare_dir('/tmp/custom_single_model', 'custom_single_model')

Callers 1

setUpMethod · 0.95

Calls 2

existsMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected