diff --git a/modelscope/utils/plugins.py b/modelscope/utils/plugins.py index 2c510dd2..1a3bfffe 100644 --- a/modelscope/utils/plugins.py +++ b/modelscope/utils/plugins.py @@ -352,7 +352,7 @@ def create_module_from_files(file_list, file_prefix, module_name): if not os.path.exists(init_file): create_empty_file(init_file) - target_file = os.path.join(target_dir, file_path) + target_file = os.path.join(target_dir, os.path.basename(file_path)) src_file = os.path.join(file_prefix, file_path) if not os.path.exists(target_file) or not filecmp.cmp( src_file, target_file): diff --git a/tests/pipelines/plugin_remote_pipelines/test_allow_remote_model.py b/tests/pipelines/plugin_remote_pipelines/test_allow_remote_model.py index 0453cf64..f18b12c5 100644 --- a/tests/pipelines/plugin_remote_pipelines/test_allow_remote_model.py +++ b/tests/pipelines/plugin_remote_pipelines/test_allow_remote_model.py @@ -35,3 +35,7 @@ class AllowRemoteModelTest(unittest.TestCase): output = inference(file_path, tile_mode=0, cache_mode=1, alpha=1) print(output) + + +if __name__ == '__main__': + unittest.main()