diff --git a/README.md b/README.md
index 3d90c7ef..5bd74b6c 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,18 @@
+
+
+
+[](https://pypi.org/project/modelscope/)
+
+[](https://github.com/modelscope/modelscope/blob/master/LICENSE)
+[](https://github.com/modelscope/modelscope/issues)
+[](https://GitHub.com/modelscope/modelscope/pull/)
+[](https://GitHub.com/modelscope/modelscope/commit/)
+
+
+
+
+
+
# Introduction
[ModelScope]( https://www.modelscope.cn) is a “Model-as-a-Service” (MaaS) platform that seeks to bring together most advanced machine learning models from the AI community, and to streamline the process of leveraging AI models in real applications. The core ModelScope library enables developers to perform inference, training and evaluation, through rich layers of API designs that facilitate a unified experience across state-of-the-art models from different AI domains.
diff --git a/modelscope/hub/git.py b/modelscope/hub/git.py
index 7943023b..51474504 100644
--- a/modelscope/hub/git.py
+++ b/modelscope/hub/git.py
@@ -94,7 +94,7 @@ class GitCommandWrapper(metaclass=Singleton):
return False
def git_lfs_install(self, repo_dir):
- cmd = ['git', '-C', repo_dir, 'lfs', 'install']
+ cmd = ['-C', repo_dir, 'lfs', 'install']
try:
self._run_git_command(*cmd)
return True
diff --git a/modelscope/models/nlp/T5/text2text_generation.py b/modelscope/models/nlp/T5/text2text_generation.py
index 0b695589..bead9e25 100644
--- a/modelscope/models/nlp/T5/text2text_generation.py
+++ b/modelscope/models/nlp/T5/text2text_generation.py
@@ -57,7 +57,7 @@ class T5ForConditionalGeneration(T5PreTrainedModel):
r'decoder\.block\.0\.layer\.1\.EncDecAttention\.relative_attention_bias\.weight',
]
- def __init__(self, config: T5Config):
+ def __init__(self, config: T5Config, **kwargs):
super().__init__(config)
self.model_dim = config.d_model
diff --git a/modelscope/models/nlp/bert/document_segmentation.py b/modelscope/models/nlp/bert/document_segmentation.py
index 36c39f43..0f2f2880 100644
--- a/modelscope/models/nlp/bert/document_segmentation.py
+++ b/modelscope/models/nlp/bert/document_segmentation.py
@@ -24,7 +24,7 @@ class BertForDocumentSegmentation(BertPreTrainedModel):
_keys_to_ignore_on_load_unexpected = [r'pooler']
- def __init__(self, config):
+ def __init__(self, config, **kwargs):
super().__init__(config)
self.num_labels = config.num_labels
self.sentence_pooler_type = None
diff --git a/modelscope/models/nlp/bert/sentence_embedding.py b/modelscope/models/nlp/bert/sentence_embedding.py
index f4c2620e..18cecd3c 100644
--- a/modelscope/models/nlp/bert/sentence_embedding.py
+++ b/modelscope/models/nlp/bert/sentence_embedding.py
@@ -11,7 +11,7 @@ from .backbone import BertModel, BertPreTrainedModel
@MODELS.register_module(Tasks.sentence_embedding, module_name=Models.bert)
class BertForSentenceEmbedding(BertPreTrainedModel):
- def __init__(self, config):
+ def __init__(self, config, **kwargs):
super().__init__(config)
self.config = config
setattr(self, self.base_model_prefix,
diff --git a/modelscope/models/nlp/bert/text_classification.py b/modelscope/models/nlp/bert/text_classification.py
index 32aab7b2..df227064 100644
--- a/modelscope/models/nlp/bert/text_classification.py
+++ b/modelscope/models/nlp/bert/text_classification.py
@@ -66,7 +66,7 @@ class BertForSequenceClassification(BertPreTrainedModel):
weights.
"""
- def __init__(self, config):
+ def __init__(self, config, **kwargs):
super().__init__(config)
self.num_labels = config.num_labels
self.config = config
diff --git a/modelscope/models/nlp/ponet/document_segmentation.py b/modelscope/models/nlp/ponet/document_segmentation.py
index 5e933491..e2cb0812 100644
--- a/modelscope/models/nlp/ponet/document_segmentation.py
+++ b/modelscope/models/nlp/ponet/document_segmentation.py
@@ -25,7 +25,7 @@ __all__ = ['PoNetForDocumentSegmentation']
class PoNetForDocumentSegmentation(PoNetPreTrainedModel):
_keys_to_ignore_on_load_unexpected = [r'pooler']
- def __init__(self, config):
+ def __init__(self, config, **kwargs):
super().__init__(config)
self.num_labels = config.num_labels
diff --git a/modelscope/pipelines/cv/video_human_matting_pipeline.py b/modelscope/pipelines/cv/video_human_matting_pipeline.py
index b4e6f2ba..e9a05d84 100644
--- a/modelscope/pipelines/cv/video_human_matting_pipeline.py
+++ b/modelscope/pipelines/cv/video_human_matting_pipeline.py
@@ -50,7 +50,7 @@ class VideoHumanMattingPipeline(Pipeline):
masks = []
rec = [None] * 4
self.model = self.model.to(self.device)
- logger.info('matting start using ', self.device)
+ logger.info('matting start using ' + self.device)
with torch.no_grad():
while True:
if frame is None:
diff --git a/modelscope/pipelines/nlp/translation_evaluation_pipeline.py b/modelscope/pipelines/nlp/translation_evaluation_pipeline.py
index bc942342..3ec3ee7d 100644
--- a/modelscope/pipelines/nlp/translation_evaluation_pipeline.py
+++ b/modelscope/pipelines/nlp/translation_evaluation_pipeline.py
@@ -77,14 +77,14 @@ class TranslationEvaluationPipeline(Pipeline):
self.preprocessor.eval_mode = eval_mode
return
- def __call__(self, input_dict: Dict[str, Union[str, List[str]]], **kwargs):
+ def __call__(self, input: Dict[str, Union[str, List[str]]], **kwargs):
r"""Implementation of __call__ function.
Args:
- input_dict: The formatted dict containing the inputted sentences.
+ input: The formatted dict containing the inputted sentences.
An example of the formatted dict:
```
- input_dict = {
+ input = {
'hyp': [
'This is a sentence.',
'This is another sentence.',
@@ -100,7 +100,7 @@ class TranslationEvaluationPipeline(Pipeline):
}
```
"""
- return super().__call__(input=input_dict, **kwargs)
+ return super().__call__(input=input, **kwargs)
def forward(self,
input_ids: List[torch.Tensor]) -> Dict[str, torch.Tensor]:
diff --git a/modelscope/trainers/hooks/checkpoint_hook.py b/modelscope/trainers/hooks/checkpoint_hook.py
index d5925dbe..5e2fedde 100644
--- a/modelscope/trainers/hooks/checkpoint_hook.py
+++ b/modelscope/trainers/hooks/checkpoint_hook.py
@@ -215,6 +215,10 @@ class CheckpointHook(Hook):
# TODO a temp fix to avoid pipeline_name and task mismatch
config['pipeline'] = {'type': config['task']}
+ # remove parallel module that is not JSON serializable
+ if 'parallel' in config and 'module' in config['parallel']:
+ del config['parallel']['module']
+
class SaveConfig:
def __init__(self, output_dir, config):
@@ -422,4 +426,5 @@ class BestCkptSaverHook(CheckpointHook):
def after_run(self, trainer):
if self.restore_best:
- self.load_checkpoint(self._best_ckpt_file, trainer)
+ if is_master():
+ self.load_checkpoint(self._best_ckpt_file, trainer)
diff --git a/modelscope/version.py b/modelscope/version.py
index 7b0750be..5df99dd8 100644
--- a/modelscope/version.py
+++ b/modelscope/version.py
@@ -1,5 +1,5 @@
# Make sure to modify __release_datetime__ to release time when making official release.
-__version__ = '1.1.0'
+__version__ = '1.1.1'
# default release datetime for branches under active development is set
# to be a time far-far-away-into-the-future
-__release_datetime__ = '2022-11-30 16:13:12'
+__release_datetime__ = '2022-12-08 00:00:00'
diff --git a/requirements/audio.txt b/requirements/audio.txt
index 44b8c6a0..95a38d94 100644
--- a/requirements/audio.txt
+++ b/requirements/audio.txt
@@ -1,6 +1,6 @@
easyasr>=0.0.2
espnet==202204
-funasr>=0.1.3
+funasr>=0.1.4
h5py
inflect
keras
diff --git a/setup.py b/setup.py
index d709dadc..5dfafefa 100644
--- a/setup.py
+++ b/setup.py
@@ -195,8 +195,8 @@ if __name__ == '__main__':
long_description_content_type='text/markdown',
author='Alibaba ModelScope team',
author_email='modelscope@list.alibaba-inc.com',
- keywords='',
- url='TBD',
+ keywords='python,nlp,science,cv,speech,multi-modal',
+ url='https://github.com/modelscope/modelscope',
packages=find_packages(exclude=('configs', 'tools', 'demo')),
include_package_data=True,
classifiers=[
@@ -204,9 +204,10 @@ if __name__ == '__main__':
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.5',
- 'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
+ 'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.10',
],
license='Apache License 2.0',
tests_require=parse_requirements('requirements/tests.txt'),
diff --git a/tests/pipelines/test_translation_evaluation.py b/tests/pipelines/test_translation_evaluation.py
index 0c73edca..76720ac0 100644
--- a/tests/pipelines/test_translation_evaluation.py
+++ b/tests/pipelines/test_translation_evaluation.py
@@ -18,7 +18,7 @@ class TranslationEvaluationTest(unittest.TestCase, DemoCompatibilityCheck):
@unittest.skipUnless(test_level() >= 0, 'skip test in current test level')
def test_run_with_model_name_for_unite_large(self):
- input_dict = {
+ input = {
'hyp': [
'This is a sentence.',
'This is another sentence.',
@@ -34,17 +34,17 @@ class TranslationEvaluationTest(unittest.TestCase, DemoCompatibilityCheck):
}
pipeline_ins = pipeline(self.task, model=self.model_id_large)
- print(pipeline_ins(input_dict))
+ print(pipeline_ins(input=input))
pipeline_ins.change_eval_mode(eval_mode=EvaluationMode.SRC)
- print(pipeline_ins(input_dict))
+ print(pipeline_ins(input=input))
pipeline_ins.change_eval_mode(eval_mode=EvaluationMode.REF)
- print(pipeline_ins(input_dict))
+ print(pipeline_ins(input=input))
@unittest.skipUnless(test_level() >= 0, 'skip test in current test level')
def test_run_with_model_name_for_unite_base(self):
- input_dict = {
+ input = {
'hyp': [
'This is a sentence.',
'This is another sentence.',
@@ -60,13 +60,13 @@ class TranslationEvaluationTest(unittest.TestCase, DemoCompatibilityCheck):
}
pipeline_ins = pipeline(self.task, model=self.model_id_base)
- print(pipeline_ins(input_dict))
+ print(pipeline_ins(input=input))
pipeline_ins.change_eval_mode(eval_mode=EvaluationMode.SRC)
- print(pipeline_ins(input_dict))
+ print(pipeline_ins(input=input))
pipeline_ins.change_eval_mode(eval_mode=EvaluationMode.REF)
- print(pipeline_ins(input_dict))
+ print(pipeline_ins(input=input))
if __name__ == '__main__':