 [to #42322933] add/refactor nlp models source code and finetune
1. add sbert,veco,palm,space source code
2. support sbert sequence classification, token classification finetune
3. support veco sequence classification finetune
4. support palm nlg finetune
evaluation result: https://sheet.alibaba-inc.com/#/sheet/f7fdcc7f22bd5105 sheet:Maas
5. add ut for finetunes
6. add veco's taskdataset processor
7. add a common trainer for nlp, and a specific trainer for veco
8. merge some duplicate codes of models, preprocessors, pipelines
Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/9574105
* add basic class of hook&metrics
* pre-commit passed
* change some comments
* pre commit passed
* 1. remove accuracy's groups 2. remove useless hooks 3. simplify priorities
* pre-commit passed
* fix a comment
* Merge branch 'master' into finetune_hooks_metrics
# Conflicts:
# modelscope/metainfo.py
* pre-commit passed
* add basic class of hook&metrics
* pre-commit passed
* change some comments
* pre commit passed
* 1. remove accuracy's groups 2. remove useless hooks 3. simplify priorities
* pre-commit passed
* fix a comment
* Merge branch 'feat/finetune' of gitlab.alibaba-inc.com:Ali-MaaS/MaaS-lib into feat/finetune
* mv hooks related to modelscope/trainers/hooks
* mv priority back
* add torch mdoel base and test
* update hooks, trainer, import_util
* add torch epoch based trainer and dis utils
* add hooks
* fix warmup
* format code stype and fix warmup and add warmup unittest
* fix impls
* pre-commit check passed
* update hook and add EpochBasedTrainer
* add trainer unittest
* Merge branch 'feat/add_hooks' into feat/add_task
# Conflicts:
# modelscope/models/base_torch.py
# modelscope/trainers/hooks/hook.py
# modelscope/trainers/trainer.py
* update unittest name
* rewrite taskdataset to trainer
* fix trainer and add unittest
* add unittest
* code: run to forward
* run through... but ugly code
* arrange some cls
* fix some errs
* revert some mistakes
* init check in
* Merge branch 'feat/add_hooks' into feat/add_task
# Conflicts:
# modelscope/trainers/trainer.py
* test with bigger epoch and size
* add the default metrics class
* move build metrics code to a method
* merge add_task
* merge origin add_task
* add device initialization
* remove preprocessor arg for bool
* add task models
* move metric collect logic to metrics class
* pre-commit passed
* fix cr comments
* precommit passed
* add task models
* Merge remote-tracking branch 'origin/feat/add_task' into feat/backbone_head
* add comment
* change comment formats.
* fix comments
* fix ut bug
* fix comments
* add wrapper check
* fix comments
* pre commit passed
* fix cr comments
* solve a loop import problem
* fix ut bug
* fix ut errors
* change dummydataset to msdataset
* precommit passed
* merge add task
* backbone-head is build, model is not correctly loaded
* model load states matched
* result matched
* lint
* add veco/palm_v2 code
* merge master
* merge master success running
* add repr model name level
* Merge branch 'feat/veco_palm' into feat/finetune_sbert_veco
* model test for training
* add token-classification metric add formal ut
* fix running bug
* finetune and pipeline are working with backbone-head
* add nli
* add missing code
* finetune and pipeline are working with backbone-head
* Merge branch 'feat/backbone_head' of http://gitlab.alibaba-inc.com/Ali-MaaS/MaaS-lib into feat/backbone_head
* add a test repo for pr
* remove merge conflicted file
* remove merge conflicted file 1
* lint check
* import error
* none type bug fix
* forward input unpacking or dict bug
* move head into models, add build_backbone with registry, no base method
* merge master
* feat: 1. add interleave dataset method 2. support multiple dataset in trainer.build_dataset 3. support 3 sub tasks in sequence_classification task
* unfinished
* update the task model structure in NLP field
* merge master
* update by comments
* keep the default model id as current on production
* unfinished
* unfinished
* veco can run
* Merge remote-tracking branch 'origin/master' into feat/backbone_head
* add taskmodel for module management
* remove forward_input_is_dict
* unfinished
* token classification started
* update base model structure
* move space to backbone
* remove 'type' in build_from_cfg method
* test update
* bug fix
* on tesing, mess code
* Merge branch 'feat/backbone_head' into feat/refactor_nlp_730
# Conflicts:
# modelscope/metrics/builder.py
# modelscope/models/__init__.py
# modelscope/models/nlp/__init__.py
# modelscope/preprocessors/nlp.py
# modelscope/trainers/trainer.py
# requirements/multi-modal.txt
* add missing merge
* add sofa source code
* refactor
* add veco task dataset
* add veco task dataset
* pre-commit passed
* fix bug of log
* add some features
* merge master
* bug fix
* refine nlp models
* fix the training error
* unfinished
* refactor pipeline
* Merge branch 'feat/backbone_head' into feat/refactor_nlp_730
# Conflicts:
# modelscope/metrics/builder.py
# modelscope/models/nlp/__init__.py
# modelscope/models/nlp/backbones/structbert/modeling_sbert.py
# modelscope/models/nlp/palm_v2/palm_for_text_generation.py
# modelscope/preprocessors/base.py
# modelscope/preprocessors/nlp.py
# modelscope/trainers/trainer.py
* Merge commit 'ab04ceafc5453ce7daa9aa09e37a55f703072a10' into feat/refactor_nlp_730
# Conflicts:
# modelscope/metainfo.py
# modelscope/metrics/builder.py
# modelscope/models/__init__.py
# modelscope/models/base/base_torch_model.py
# modelscope/models/nlp/__init__.py
# modelscope/models/nlp/backbones/space/model/intent_unified_transformer.py
# modelscope/models/nlp/backbones/space/model/model_base.py
# modelscope/models/nlp/palm_v2/palm_for_text_generation.py
# modelscope/models/nlp/sbert_for_sequence_classification.py
# modelscope/models/nlp/sequence_classification.py
# modelscope/models/nlp/space/__init__.py
# modelscope/models/nlp/space_for_dialog_intent_prediction.py
# modelscope/models/nlp/space_for_dialog_modeling.py
# modelscope/models/nlp/space_for_dialog_state_tracking.py
# modelscope/models/nlp/task_model.py
# modelscope/pipelines/nlp/sentiment_classification_pipeline.py
# modelscope/preprocessors/base.py
# modelscope/preprocessors/nlp.py
# modelscope/trainers/trainer.py
* revert changes
* unify sentnece classification postprocess
* revert some changes, move some model files
* pipeline first case run through
* ws pipeline passed
* Merge branch 'feat/refactor_nlp_730' into feat/finetune_sbert_veco
* finetune
* revert code
* revert some code
* ws finetune started, only the accuracy is weird
* Merge branch 'feat/veco_taskdataset' into feat/finetune_sbert_veco
# Conflicts:
# modelscope/task_datasets/veco_dataset.py
# tests/taskdataset/test_veco_dataset.py
* veco+nli finetune started
* Merge branch 'master' into feat/finetune_sbert_veco
# Conflicts:
# modelscope/models/nlp/sbert_for_sequence_classification.py
# modelscope/models/nlp/sbert_for_token_classification.py
# modelscope/models/nlp/sbert_for_zero_shot_classification.py
# modelscope/models/nlp/space/space_for_dialog_intent_prediction.py
# modelscope/models/nlp/space/space_for_dialog_modeling.py
# modelscope/trainers/trainer.py
* add trainer for nlp
* trainer: dataset params passed into preprocessor
* test passed by nlptrainer
* fix some bugs
* fix some bugs
* add backbone/head subclass
* fix regression bugs
* fix bug in token-cls finetune
* support cfg modification
* fix bug
* fix bug
* update requirements
* add some comments and fix some t
* add some comments and revert a argument
* split to two test files
* revert code
* fixbug in precessor
(cherry picked from commit 7a648d096ef8500c694d3255dabe29e6f4bfc3e5)
* fix ut bug
* support sbert models
* unfinished
* Merge branch 'feat/finetune_sbert_veco' into sly_tmp_veco_finetune
# Conflicts:
# tests/trainers/test_finetune_sequence_classification.py
* fixbug in veco
* fix bug
* fixbug
* correct running params
* remove useless files
* add palm finetuning with cnn_dailymail dataset
* copy space model from sofa
* Merge branch 'feat/finetune_sbert_veco' of gitlab.alibaba-inc.com:Ali-MaaS/MaaS-lib into feat/finetune_sbert_veco
* Merge branch 'master' into feat/finetune_sbert_veco
# Conflicts:
# modelscope/metrics/__init__.py
# modelscope/models/__init__.py
# modelscope/models/nlp/__init__.py
# modelscope/models/nlp/backbones/__init__.py
# modelscope/models/nlp/backbones/structbert/modeling_sbert.py
# modelscope/models/nlp/heads/__init__.py
# modelscope/models/nlp/masked_language.py
# modelscope/models/nlp/palm_v2/palm_for_text_generation.py
# modelscope/models/nlp/sbert_for_nli.py
# modelscope/models/nlp/sbert_for_sentence_similarity.py
# modelscope/models/nlp/sbert_for_sentiment_classification.py
# modelscope/models/nlp/sbert_for_sequence_classification.py
# modelscope/models/nlp/sbert_for_token_classification.py
# modelscope/models/nlp/sbert_for_zero_shot_classification.py
# modelscope/models/nlp/sequence_classification.py
# modelscope/models/nlp/space/space_for_dialog_intent_prediction.py
# modelscope/models/nlp/space/space_for_dialog_modeling.py
# modelscope/models/nlp/space/space_for_dialog_state_tracking.py
# modelscope/models/nlp/structbert/adv_utils.py
# modelscope/models/nlp/structbert/configuration_sbert.py
# modelscope/models/nlp/task_models/task_model.py
# modelscope/pipelines/__init__.py
# modelscope/pipelines/nlp/__init__.py
# modelscope/pipelines/nlp/fill_mask_pipeline.py
# modelscope/pipelines/nlp/named_entity_recognition_pipeline.py
# modelscope/pipelines/nlp/nli_pipeline.py
# modelscope/pipelines/nlp/sentence_similarity_pipeline.py
# modelscope/pipelines/nlp/sentiment_classification_pipeline.py
# modelscope/pipelines/nlp/text_generation_pipeline.py
# modelscope/pipelines/nlp/word_segmentation_pipeline.py
# modelscope/pipelines/nlp/zero_shot_classification_pipeline.py
# modelscope/preprocessors/nlp.py
# modelscope/task_datasets/__init__.py
# modelscope/trainers/trainer.py
# modelscope/trainers/utils/inference.py
# modelscope/utils/file_utils.py
# requirements/nlp.txt
# tests/pipelines/test_nli.py
# tests/pipelines/test_sentence_similarity.py
# tests/pipelines/test_sentiment_classification.py
* fix imports
* mark backbone in their own modeling
* pre-commit check passed
* pre-commit passed, remove roberta model
* fix a bug in ast import
* skip all finetune uts
* fix bugs
* pre-commit passed
* bug fixed
* bug fixed
* bug fixed
* bug fixed
* fix ut bug
* fix bug
* fix ut bug
* fix bug
* fix bug
* fixbugs
* fixbug
* revert veco
* revert veco because of core dump
* fix palm bug
* revert veco
* revert mistaken code
* add a test print
* pre-commit check
* test exception
* add test code
* for test
* fix bug and test
* remove test code
* remove useless file
* 1. fix some bugs 2. add backbone ut
* Merge branch 'master' into feat/finetune_refactor_730
# Conflicts:
# modelscope/metainfo.py
# modelscope/metrics/sequence_classification_metric.py
# modelscope/models/nlp/__init__.py
# modelscope/models/nlp/task_models/task_model.py
# modelscope/preprocessors/__init__.py
# modelscope/preprocessors/nlp.py
# modelscope/trainers/trainer.py
# modelscope/trainers/utils/inference.py
# modelscope/utils/file_utils.py
# tests/trainers/test_trainer_with_nlp.py
* pre-commit passed
* revert files
* increase test level
* unregister models
* fix bugs
* fix cr comments
* fix bug in backbone-head
* add sbert backbone
* fix bug
* add test for token-cls-metric
* pre-commit passed
* fix ut comments
* revert normal tokenizer to fast tokenizer
* Merge branch 'master' into feat/finetune_refactor_730
# Conflicts:
# modelscope/models/nlp/__init__.py
# modelscope/models/nlp/backbones/__init__.py
# modelscope/models/nlp/backbones/structbert/__init__.py
# modelscope/models/nlp/masked_language.py
# modelscope/models/nlp/palm_v2/palm_for_text_generation.py
# modelscope/models/nlp/sbert_for_sequence_classification.py
# modelscope/models/nlp/sbert_for_token_classification.py
# modelscope/models/nlp/sbert_for_zero_shot_classification.py
# modelscope/pipelines/nlp/text_generation_pipeline.py
# modelscope/preprocessors/nlp.py
# modelscope/trainers/trainer.py
# modelscope/trainers/utils/inference.py
* fix merge bugs
* pre commit passed
* fix bug
* fix bug
* fix bug
* fix bug from master
* add print
* fix ut bug
* fix bug
* Merge branch 'master' into feat/finetune_refactor_730
* skip task model test 3 years ago  [to #42322933] add/refactor nlp models source code and finetune
1. add sbert,veco,palm,space source code
2. support sbert sequence classification, token classification finetune
3. support veco sequence classification finetune
4. support palm nlg finetune
evaluation result: https://sheet.alibaba-inc.com/#/sheet/f7fdcc7f22bd5105 sheet:Maas
5. add ut for finetunes
6. add veco's taskdataset processor
7. add a common trainer for nlp, and a specific trainer for veco
8. merge some duplicate codes of models, preprocessors, pipelines
Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/9574105
* add basic class of hook&metrics
* pre-commit passed
* change some comments
* pre commit passed
* 1. remove accuracy's groups 2. remove useless hooks 3. simplify priorities
* pre-commit passed
* fix a comment
* Merge branch 'master' into finetune_hooks_metrics
# Conflicts:
# modelscope/metainfo.py
* pre-commit passed
* add basic class of hook&metrics
* pre-commit passed
* change some comments
* pre commit passed
* 1. remove accuracy's groups 2. remove useless hooks 3. simplify priorities
* pre-commit passed
* fix a comment
* Merge branch 'feat/finetune' of gitlab.alibaba-inc.com:Ali-MaaS/MaaS-lib into feat/finetune
* mv hooks related to modelscope/trainers/hooks
* mv priority back
* add torch mdoel base and test
* update hooks, trainer, import_util
* add torch epoch based trainer and dis utils
* add hooks
* fix warmup
* format code stype and fix warmup and add warmup unittest
* fix impls
* pre-commit check passed
* update hook and add EpochBasedTrainer
* add trainer unittest
* Merge branch 'feat/add_hooks' into feat/add_task
# Conflicts:
# modelscope/models/base_torch.py
# modelscope/trainers/hooks/hook.py
# modelscope/trainers/trainer.py
* update unittest name
* rewrite taskdataset to trainer
* fix trainer and add unittest
* add unittest
* code: run to forward
* run through... but ugly code
* arrange some cls
* fix some errs
* revert some mistakes
* init check in
* Merge branch 'feat/add_hooks' into feat/add_task
# Conflicts:
# modelscope/trainers/trainer.py
* test with bigger epoch and size
* add the default metrics class
* move build metrics code to a method
* merge add_task
* merge origin add_task
* add device initialization
* remove preprocessor arg for bool
* add task models
* move metric collect logic to metrics class
* pre-commit passed
* fix cr comments
* precommit passed
* add task models
* Merge remote-tracking branch 'origin/feat/add_task' into feat/backbone_head
* add comment
* change comment formats.
* fix comments
* fix ut bug
* fix comments
* add wrapper check
* fix comments
* pre commit passed
* fix cr comments
* solve a loop import problem
* fix ut bug
* fix ut errors
* change dummydataset to msdataset
* precommit passed
* merge add task
* backbone-head is build, model is not correctly loaded
* model load states matched
* result matched
* lint
* add veco/palm_v2 code
* merge master
* merge master success running
* add repr model name level
* Merge branch 'feat/veco_palm' into feat/finetune_sbert_veco
* model test for training
* add token-classification metric add formal ut
* fix running bug
* finetune and pipeline are working with backbone-head
* add nli
* add missing code
* finetune and pipeline are working with backbone-head
* Merge branch 'feat/backbone_head' of http://gitlab.alibaba-inc.com/Ali-MaaS/MaaS-lib into feat/backbone_head
* add a test repo for pr
* remove merge conflicted file
* remove merge conflicted file 1
* lint check
* import error
* none type bug fix
* forward input unpacking or dict bug
* move head into models, add build_backbone with registry, no base method
* merge master
* feat: 1. add interleave dataset method 2. support multiple dataset in trainer.build_dataset 3. support 3 sub tasks in sequence_classification task
* unfinished
* update the task model structure in NLP field
* merge master
* update by comments
* keep the default model id as current on production
* unfinished
* unfinished
* veco can run
* Merge remote-tracking branch 'origin/master' into feat/backbone_head
* add taskmodel for module management
* remove forward_input_is_dict
* unfinished
* token classification started
* update base model structure
* move space to backbone
* remove 'type' in build_from_cfg method
* test update
* bug fix
* on tesing, mess code
* Merge branch 'feat/backbone_head' into feat/refactor_nlp_730
# Conflicts:
# modelscope/metrics/builder.py
# modelscope/models/__init__.py
# modelscope/models/nlp/__init__.py
# modelscope/preprocessors/nlp.py
# modelscope/trainers/trainer.py
# requirements/multi-modal.txt
* add missing merge
* add sofa source code
* refactor
* add veco task dataset
* add veco task dataset
* pre-commit passed
* fix bug of log
* add some features
* merge master
* bug fix
* refine nlp models
* fix the training error
* unfinished
* refactor pipeline
* Merge branch 'feat/backbone_head' into feat/refactor_nlp_730
# Conflicts:
# modelscope/metrics/builder.py
# modelscope/models/nlp/__init__.py
# modelscope/models/nlp/backbones/structbert/modeling_sbert.py
# modelscope/models/nlp/palm_v2/palm_for_text_generation.py
# modelscope/preprocessors/base.py
# modelscope/preprocessors/nlp.py
# modelscope/trainers/trainer.py
* Merge commit 'ab04ceafc5453ce7daa9aa09e37a55f703072a10' into feat/refactor_nlp_730
# Conflicts:
# modelscope/metainfo.py
# modelscope/metrics/builder.py
# modelscope/models/__init__.py
# modelscope/models/base/base_torch_model.py
# modelscope/models/nlp/__init__.py
# modelscope/models/nlp/backbones/space/model/intent_unified_transformer.py
# modelscope/models/nlp/backbones/space/model/model_base.py
# modelscope/models/nlp/palm_v2/palm_for_text_generation.py
# modelscope/models/nlp/sbert_for_sequence_classification.py
# modelscope/models/nlp/sequence_classification.py
# modelscope/models/nlp/space/__init__.py
# modelscope/models/nlp/space_for_dialog_intent_prediction.py
# modelscope/models/nlp/space_for_dialog_modeling.py
# modelscope/models/nlp/space_for_dialog_state_tracking.py
# modelscope/models/nlp/task_model.py
# modelscope/pipelines/nlp/sentiment_classification_pipeline.py
# modelscope/preprocessors/base.py
# modelscope/preprocessors/nlp.py
# modelscope/trainers/trainer.py
* revert changes
* unify sentnece classification postprocess
* revert some changes, move some model files
* pipeline first case run through
* ws pipeline passed
* Merge branch 'feat/refactor_nlp_730' into feat/finetune_sbert_veco
* finetune
* revert code
* revert some code
* ws finetune started, only the accuracy is weird
* Merge branch 'feat/veco_taskdataset' into feat/finetune_sbert_veco
# Conflicts:
# modelscope/task_datasets/veco_dataset.py
# tests/taskdataset/test_veco_dataset.py
* veco+nli finetune started
* Merge branch 'master' into feat/finetune_sbert_veco
# Conflicts:
# modelscope/models/nlp/sbert_for_sequence_classification.py
# modelscope/models/nlp/sbert_for_token_classification.py
# modelscope/models/nlp/sbert_for_zero_shot_classification.py
# modelscope/models/nlp/space/space_for_dialog_intent_prediction.py
# modelscope/models/nlp/space/space_for_dialog_modeling.py
# modelscope/trainers/trainer.py
* add trainer for nlp
* trainer: dataset params passed into preprocessor
* test passed by nlptrainer
* fix some bugs
* fix some bugs
* add backbone/head subclass
* fix regression bugs
* fix bug in token-cls finetune
* support cfg modification
* fix bug
* fix bug
* update requirements
* add some comments and fix some t
* add some comments and revert a argument
* split to two test files
* revert code
* fixbug in precessor
(cherry picked from commit 7a648d096ef8500c694d3255dabe29e6f4bfc3e5)
* fix ut bug
* support sbert models
* unfinished
* Merge branch 'feat/finetune_sbert_veco' into sly_tmp_veco_finetune
# Conflicts:
# tests/trainers/test_finetune_sequence_classification.py
* fixbug in veco
* fix bug
* fixbug
* correct running params
* remove useless files
* add palm finetuning with cnn_dailymail dataset
* copy space model from sofa
* Merge branch 'feat/finetune_sbert_veco' of gitlab.alibaba-inc.com:Ali-MaaS/MaaS-lib into feat/finetune_sbert_veco
* Merge branch 'master' into feat/finetune_sbert_veco
# Conflicts:
# modelscope/metrics/__init__.py
# modelscope/models/__init__.py
# modelscope/models/nlp/__init__.py
# modelscope/models/nlp/backbones/__init__.py
# modelscope/models/nlp/backbones/structbert/modeling_sbert.py
# modelscope/models/nlp/heads/__init__.py
# modelscope/models/nlp/masked_language.py
# modelscope/models/nlp/palm_v2/palm_for_text_generation.py
# modelscope/models/nlp/sbert_for_nli.py
# modelscope/models/nlp/sbert_for_sentence_similarity.py
# modelscope/models/nlp/sbert_for_sentiment_classification.py
# modelscope/models/nlp/sbert_for_sequence_classification.py
# modelscope/models/nlp/sbert_for_token_classification.py
# modelscope/models/nlp/sbert_for_zero_shot_classification.py
# modelscope/models/nlp/sequence_classification.py
# modelscope/models/nlp/space/space_for_dialog_intent_prediction.py
# modelscope/models/nlp/space/space_for_dialog_modeling.py
# modelscope/models/nlp/space/space_for_dialog_state_tracking.py
# modelscope/models/nlp/structbert/adv_utils.py
# modelscope/models/nlp/structbert/configuration_sbert.py
# modelscope/models/nlp/task_models/task_model.py
# modelscope/pipelines/__init__.py
# modelscope/pipelines/nlp/__init__.py
# modelscope/pipelines/nlp/fill_mask_pipeline.py
# modelscope/pipelines/nlp/named_entity_recognition_pipeline.py
# modelscope/pipelines/nlp/nli_pipeline.py
# modelscope/pipelines/nlp/sentence_similarity_pipeline.py
# modelscope/pipelines/nlp/sentiment_classification_pipeline.py
# modelscope/pipelines/nlp/text_generation_pipeline.py
# modelscope/pipelines/nlp/word_segmentation_pipeline.py
# modelscope/pipelines/nlp/zero_shot_classification_pipeline.py
# modelscope/preprocessors/nlp.py
# modelscope/task_datasets/__init__.py
# modelscope/trainers/trainer.py
# modelscope/trainers/utils/inference.py
# modelscope/utils/file_utils.py
# requirements/nlp.txt
# tests/pipelines/test_nli.py
# tests/pipelines/test_sentence_similarity.py
# tests/pipelines/test_sentiment_classification.py
* fix imports
* mark backbone in their own modeling
* pre-commit check passed
* pre-commit passed, remove roberta model
* fix a bug in ast import
* skip all finetune uts
* fix bugs
* pre-commit passed
* bug fixed
* bug fixed
* bug fixed
* bug fixed
* fix ut bug
* fix bug
* fix ut bug
* fix bug
* fix bug
* fixbugs
* fixbug
* revert veco
* revert veco because of core dump
* fix palm bug
* revert veco
* revert mistaken code
* add a test print
* pre-commit check
* test exception
* add test code
* for test
* fix bug and test
* remove test code
* remove useless file
* 1. fix some bugs 2. add backbone ut
* Merge branch 'master' into feat/finetune_refactor_730
# Conflicts:
# modelscope/metainfo.py
# modelscope/metrics/sequence_classification_metric.py
# modelscope/models/nlp/__init__.py
# modelscope/models/nlp/task_models/task_model.py
# modelscope/preprocessors/__init__.py
# modelscope/preprocessors/nlp.py
# modelscope/trainers/trainer.py
# modelscope/trainers/utils/inference.py
# modelscope/utils/file_utils.py
# tests/trainers/test_trainer_with_nlp.py
* pre-commit passed
* revert files
* increase test level
* unregister models
* fix bugs
* fix cr comments
* fix bug in backbone-head
* add sbert backbone
* fix bug
* add test for token-cls-metric
* pre-commit passed
* fix ut comments
* revert normal tokenizer to fast tokenizer
* Merge branch 'master' into feat/finetune_refactor_730
# Conflicts:
# modelscope/models/nlp/__init__.py
# modelscope/models/nlp/backbones/__init__.py
# modelscope/models/nlp/backbones/structbert/__init__.py
# modelscope/models/nlp/masked_language.py
# modelscope/models/nlp/palm_v2/palm_for_text_generation.py
# modelscope/models/nlp/sbert_for_sequence_classification.py
# modelscope/models/nlp/sbert_for_token_classification.py
# modelscope/models/nlp/sbert_for_zero_shot_classification.py
# modelscope/pipelines/nlp/text_generation_pipeline.py
# modelscope/preprocessors/nlp.py
# modelscope/trainers/trainer.py
# modelscope/trainers/utils/inference.py
* fix merge bugs
* pre commit passed
* fix bug
* fix bug
* fix bug
* fix bug from master
* add print
* fix ut bug
* fix bug
* Merge branch 'master' into feat/finetune_refactor_730
* skip task model test 3 years ago  [to #42322933] add/refactor nlp models source code and finetune
1. add sbert,veco,palm,space source code
2. support sbert sequence classification, token classification finetune
3. support veco sequence classification finetune
4. support palm nlg finetune
evaluation result: https://sheet.alibaba-inc.com/#/sheet/f7fdcc7f22bd5105 sheet:Maas
5. add ut for finetunes
6. add veco's taskdataset processor
7. add a common trainer for nlp, and a specific trainer for veco
8. merge some duplicate codes of models, preprocessors, pipelines
Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/9574105
* add basic class of hook&metrics
* pre-commit passed
* change some comments
* pre commit passed
* 1. remove accuracy's groups 2. remove useless hooks 3. simplify priorities
* pre-commit passed
* fix a comment
* Merge branch 'master' into finetune_hooks_metrics
# Conflicts:
# modelscope/metainfo.py
* pre-commit passed
* add basic class of hook&metrics
* pre-commit passed
* change some comments
* pre commit passed
* 1. remove accuracy's groups 2. remove useless hooks 3. simplify priorities
* pre-commit passed
* fix a comment
* Merge branch 'feat/finetune' of gitlab.alibaba-inc.com:Ali-MaaS/MaaS-lib into feat/finetune
* mv hooks related to modelscope/trainers/hooks
* mv priority back
* add torch mdoel base and test
* update hooks, trainer, import_util
* add torch epoch based trainer and dis utils
* add hooks
* fix warmup
* format code stype and fix warmup and add warmup unittest
* fix impls
* pre-commit check passed
* update hook and add EpochBasedTrainer
* add trainer unittest
* Merge branch 'feat/add_hooks' into feat/add_task
# Conflicts:
# modelscope/models/base_torch.py
# modelscope/trainers/hooks/hook.py
# modelscope/trainers/trainer.py
* update unittest name
* rewrite taskdataset to trainer
* fix trainer and add unittest
* add unittest
* code: run to forward
* run through... but ugly code
* arrange some cls
* fix some errs
* revert some mistakes
* init check in
* Merge branch 'feat/add_hooks' into feat/add_task
# Conflicts:
# modelscope/trainers/trainer.py
* test with bigger epoch and size
* add the default metrics class
* move build metrics code to a method
* merge add_task
* merge origin add_task
* add device initialization
* remove preprocessor arg for bool
* add task models
* move metric collect logic to metrics class
* pre-commit passed
* fix cr comments
* precommit passed
* add task models
* Merge remote-tracking branch 'origin/feat/add_task' into feat/backbone_head
* add comment
* change comment formats.
* fix comments
* fix ut bug
* fix comments
* add wrapper check
* fix comments
* pre commit passed
* fix cr comments
* solve a loop import problem
* fix ut bug
* fix ut errors
* change dummydataset to msdataset
* precommit passed
* merge add task
* backbone-head is build, model is not correctly loaded
* model load states matched
* result matched
* lint
* add veco/palm_v2 code
* merge master
* merge master success running
* add repr model name level
* Merge branch 'feat/veco_palm' into feat/finetune_sbert_veco
* model test for training
* add token-classification metric add formal ut
* fix running bug
* finetune and pipeline are working with backbone-head
* add nli
* add missing code
* finetune and pipeline are working with backbone-head
* Merge branch 'feat/backbone_head' of http://gitlab.alibaba-inc.com/Ali-MaaS/MaaS-lib into feat/backbone_head
* add a test repo for pr
* remove merge conflicted file
* remove merge conflicted file 1
* lint check
* import error
* none type bug fix
* forward input unpacking or dict bug
* move head into models, add build_backbone with registry, no base method
* merge master
* feat: 1. add interleave dataset method 2. support multiple dataset in trainer.build_dataset 3. support 3 sub tasks in sequence_classification task
* unfinished
* update the task model structure in NLP field
* merge master
* update by comments
* keep the default model id as current on production
* unfinished
* unfinished
* veco can run
* Merge remote-tracking branch 'origin/master' into feat/backbone_head
* add taskmodel for module management
* remove forward_input_is_dict
* unfinished
* token classification started
* update base model structure
* move space to backbone
* remove 'type' in build_from_cfg method
* test update
* bug fix
* on tesing, mess code
* Merge branch 'feat/backbone_head' into feat/refactor_nlp_730
# Conflicts:
# modelscope/metrics/builder.py
# modelscope/models/__init__.py
# modelscope/models/nlp/__init__.py
# modelscope/preprocessors/nlp.py
# modelscope/trainers/trainer.py
# requirements/multi-modal.txt
* add missing merge
* add sofa source code
* refactor
* add veco task dataset
* add veco task dataset
* pre-commit passed
* fix bug of log
* add some features
* merge master
* bug fix
* refine nlp models
* fix the training error
* unfinished
* refactor pipeline
* Merge branch 'feat/backbone_head' into feat/refactor_nlp_730
# Conflicts:
# modelscope/metrics/builder.py
# modelscope/models/nlp/__init__.py
# modelscope/models/nlp/backbones/structbert/modeling_sbert.py
# modelscope/models/nlp/palm_v2/palm_for_text_generation.py
# modelscope/preprocessors/base.py
# modelscope/preprocessors/nlp.py
# modelscope/trainers/trainer.py
* Merge commit 'ab04ceafc5453ce7daa9aa09e37a55f703072a10' into feat/refactor_nlp_730
# Conflicts:
# modelscope/metainfo.py
# modelscope/metrics/builder.py
# modelscope/models/__init__.py
# modelscope/models/base/base_torch_model.py
# modelscope/models/nlp/__init__.py
# modelscope/models/nlp/backbones/space/model/intent_unified_transformer.py
# modelscope/models/nlp/backbones/space/model/model_base.py
# modelscope/models/nlp/palm_v2/palm_for_text_generation.py
# modelscope/models/nlp/sbert_for_sequence_classification.py
# modelscope/models/nlp/sequence_classification.py
# modelscope/models/nlp/space/__init__.py
# modelscope/models/nlp/space_for_dialog_intent_prediction.py
# modelscope/models/nlp/space_for_dialog_modeling.py
# modelscope/models/nlp/space_for_dialog_state_tracking.py
# modelscope/models/nlp/task_model.py
# modelscope/pipelines/nlp/sentiment_classification_pipeline.py
# modelscope/preprocessors/base.py
# modelscope/preprocessors/nlp.py
# modelscope/trainers/trainer.py
* revert changes
* unify sentnece classification postprocess
* revert some changes, move some model files
* pipeline first case run through
* ws pipeline passed
* Merge branch 'feat/refactor_nlp_730' into feat/finetune_sbert_veco
* finetune
* revert code
* revert some code
* ws finetune started, only the accuracy is weird
* Merge branch 'feat/veco_taskdataset' into feat/finetune_sbert_veco
# Conflicts:
# modelscope/task_datasets/veco_dataset.py
# tests/taskdataset/test_veco_dataset.py
* veco+nli finetune started
* Merge branch 'master' into feat/finetune_sbert_veco
# Conflicts:
# modelscope/models/nlp/sbert_for_sequence_classification.py
# modelscope/models/nlp/sbert_for_token_classification.py
# modelscope/models/nlp/sbert_for_zero_shot_classification.py
# modelscope/models/nlp/space/space_for_dialog_intent_prediction.py
# modelscope/models/nlp/space/space_for_dialog_modeling.py
# modelscope/trainers/trainer.py
* add trainer for nlp
* trainer: dataset params passed into preprocessor
* test passed by nlptrainer
* fix some bugs
* fix some bugs
* add backbone/head subclass
* fix regression bugs
* fix bug in token-cls finetune
* support cfg modification
* fix bug
* fix bug
* update requirements
* add some comments and fix some t
* add some comments and revert a argument
* split to two test files
* revert code
* fixbug in precessor
(cherry picked from commit 7a648d096ef8500c694d3255dabe29e6f4bfc3e5)
* fix ut bug
* support sbert models
* unfinished
* Merge branch 'feat/finetune_sbert_veco' into sly_tmp_veco_finetune
# Conflicts:
# tests/trainers/test_finetune_sequence_classification.py
* fixbug in veco
* fix bug
* fixbug
* correct running params
* remove useless files
* add palm finetuning with cnn_dailymail dataset
* copy space model from sofa
* Merge branch 'feat/finetune_sbert_veco' of gitlab.alibaba-inc.com:Ali-MaaS/MaaS-lib into feat/finetune_sbert_veco
* Merge branch 'master' into feat/finetune_sbert_veco
# Conflicts:
# modelscope/metrics/__init__.py
# modelscope/models/__init__.py
# modelscope/models/nlp/__init__.py
# modelscope/models/nlp/backbones/__init__.py
# modelscope/models/nlp/backbones/structbert/modeling_sbert.py
# modelscope/models/nlp/heads/__init__.py
# modelscope/models/nlp/masked_language.py
# modelscope/models/nlp/palm_v2/palm_for_text_generation.py
# modelscope/models/nlp/sbert_for_nli.py
# modelscope/models/nlp/sbert_for_sentence_similarity.py
# modelscope/models/nlp/sbert_for_sentiment_classification.py
# modelscope/models/nlp/sbert_for_sequence_classification.py
# modelscope/models/nlp/sbert_for_token_classification.py
# modelscope/models/nlp/sbert_for_zero_shot_classification.py
# modelscope/models/nlp/sequence_classification.py
# modelscope/models/nlp/space/space_for_dialog_intent_prediction.py
# modelscope/models/nlp/space/space_for_dialog_modeling.py
# modelscope/models/nlp/space/space_for_dialog_state_tracking.py
# modelscope/models/nlp/structbert/adv_utils.py
# modelscope/models/nlp/structbert/configuration_sbert.py
# modelscope/models/nlp/task_models/task_model.py
# modelscope/pipelines/__init__.py
# modelscope/pipelines/nlp/__init__.py
# modelscope/pipelines/nlp/fill_mask_pipeline.py
# modelscope/pipelines/nlp/named_entity_recognition_pipeline.py
# modelscope/pipelines/nlp/nli_pipeline.py
# modelscope/pipelines/nlp/sentence_similarity_pipeline.py
# modelscope/pipelines/nlp/sentiment_classification_pipeline.py
# modelscope/pipelines/nlp/text_generation_pipeline.py
# modelscope/pipelines/nlp/word_segmentation_pipeline.py
# modelscope/pipelines/nlp/zero_shot_classification_pipeline.py
# modelscope/preprocessors/nlp.py
# modelscope/task_datasets/__init__.py
# modelscope/trainers/trainer.py
# modelscope/trainers/utils/inference.py
# modelscope/utils/file_utils.py
# requirements/nlp.txt
# tests/pipelines/test_nli.py
# tests/pipelines/test_sentence_similarity.py
# tests/pipelines/test_sentiment_classification.py
* fix imports
* mark backbone in their own modeling
* pre-commit check passed
* pre-commit passed, remove roberta model
* fix a bug in ast import
* skip all finetune uts
* fix bugs
* pre-commit passed
* bug fixed
* bug fixed
* bug fixed
* bug fixed
* fix ut bug
* fix bug
* fix ut bug
* fix bug
* fix bug
* fixbugs
* fixbug
* revert veco
* revert veco because of core dump
* fix palm bug
* revert veco
* revert mistaken code
* add a test print
* pre-commit check
* test exception
* add test code
* for test
* fix bug and test
* remove test code
* remove useless file
* 1. fix some bugs 2. add backbone ut
* Merge branch 'master' into feat/finetune_refactor_730
# Conflicts:
# modelscope/metainfo.py
# modelscope/metrics/sequence_classification_metric.py
# modelscope/models/nlp/__init__.py
# modelscope/models/nlp/task_models/task_model.py
# modelscope/preprocessors/__init__.py
# modelscope/preprocessors/nlp.py
# modelscope/trainers/trainer.py
# modelscope/trainers/utils/inference.py
# modelscope/utils/file_utils.py
# tests/trainers/test_trainer_with_nlp.py
* pre-commit passed
* revert files
* increase test level
* unregister models
* fix bugs
* fix cr comments
* fix bug in backbone-head
* add sbert backbone
* fix bug
* add test for token-cls-metric
* pre-commit passed
* fix ut comments
* revert normal tokenizer to fast tokenizer
* Merge branch 'master' into feat/finetune_refactor_730
# Conflicts:
# modelscope/models/nlp/__init__.py
# modelscope/models/nlp/backbones/__init__.py
# modelscope/models/nlp/backbones/structbert/__init__.py
# modelscope/models/nlp/masked_language.py
# modelscope/models/nlp/palm_v2/palm_for_text_generation.py
# modelscope/models/nlp/sbert_for_sequence_classification.py
# modelscope/models/nlp/sbert_for_token_classification.py
# modelscope/models/nlp/sbert_for_zero_shot_classification.py
# modelscope/pipelines/nlp/text_generation_pipeline.py
# modelscope/preprocessors/nlp.py
# modelscope/trainers/trainer.py
# modelscope/trainers/utils/inference.py
* fix merge bugs
* pre commit passed
* fix bug
* fix bug
* fix bug
* fix bug from master
* add print
* fix ut bug
* fix bug
* Merge branch 'master' into feat/finetune_refactor_730
* skip task model test 3 years ago |
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413 |
- # Copyright (c) Alibaba, Inc. and its affiliates.
-
-
- class Models(object):
- """ Names for different models.
-
- Holds the standard model name to use for identifying different model.
- This should be used to register models.
-
- Model name should only contain model info but not task info.
- """
- tinynas_detection = 'tinynas-detection'
-
- # vision models
- detection = 'detection'
- realtime_object_detection = 'realtime-object-detection'
- scrfd = 'scrfd'
- classification_model = 'ClassificationModel'
- nafnet = 'nafnet'
- csrnet = 'csrnet'
- cascade_mask_rcnn_swin = 'cascade_mask_rcnn_swin'
- gpen = 'gpen'
- product_retrieval_embedding = 'product-retrieval-embedding'
- body_2d_keypoints = 'body-2d-keypoints'
- body_3d_keypoints = 'body-3d-keypoints'
- crowd_counting = 'HRNetCrowdCounting'
- face_2d_keypoints = 'face-2d-keypoints'
- panoptic_segmentation = 'swinL-panoptic-segmentation'
- image_reid_person = 'passvitb'
- video_summarization = 'pgl-video-summarization'
- swinL_semantic_segmentation = 'swinL-semantic-segmentation'
- vitadapter_semantic_segmentation = 'vitadapter-semantic-segmentation'
- text_driven_segmentation = 'text-driven-segmentation'
- resnet50_bert = 'resnet50-bert'
- fer = 'fer'
- retinaface = 'retinaface'
- shop_segmentation = 'shop-segmentation'
- mogface = 'mogface'
- mtcnn = 'mtcnn'
- ulfd = 'ulfd'
- video_inpainting = 'video-inpainting'
- hand_static = 'hand-static'
-
- # EasyCV models
- yolox = 'YOLOX'
- segformer = 'Segformer'
-
- # nlp models
- bert = 'bert'
- palm = 'palm-v2'
- structbert = 'structbert'
- deberta_v2 = 'deberta_v2'
- veco = 'veco'
- translation = 'csanmt-translation'
- space_dst = 'space-dst'
- space_intent = 'space-intent'
- space_modeling = 'space-modeling'
- star = 'star'
- star3 = 'star3'
- tcrf = 'transformer-crf'
- transformer_softmax = 'transformer-softmax'
- lcrf = 'lstm-crf'
- gcnncrf = 'gcnn-crf'
- bart = 'bart'
- gpt3 = 'gpt3'
- plug = 'plug'
- bert_for_ds = 'bert-for-document-segmentation'
- ponet = 'ponet'
- T5 = 'T5'
-
- # audio models
- sambert_hifigan = 'sambert-hifigan'
- speech_frcrn_ans_cirm_16k = 'speech_frcrn_ans_cirm_16k'
- speech_dfsmn_kws_char_farfield = 'speech_dfsmn_kws_char_farfield'
- kws_kwsbp = 'kws-kwsbp'
- generic_asr = 'generic-asr'
-
- # multi-modal models
- ofa = 'ofa'
- clip = 'clip-multi-modal-embedding'
- gemm = 'gemm-generative-multi-modal'
- mplug = 'mplug'
- diffusion = 'diffusion-text-to-image-synthesis'
- multi_stage_diffusion = 'multi-stage-diffusion-text-to-image-synthesis'
- team = 'team-multi-modal-similarity'
- video_clip = 'video-clip-multi-modal-embedding'
-
-
- class TaskModels(object):
- # nlp task
- text_classification = 'text-classification'
- token_classification = 'token-classification'
- information_extraction = 'information-extraction'
- fill_mask = 'fill-mask'
- feature_extraction = 'feature-extraction'
-
-
- class Heads(object):
- # nlp heads
-
- # text cls
- text_classification = 'text-classification'
- # fill mask
- fill_mask = 'fill-mask'
- bert_mlm = 'bert-mlm'
- roberta_mlm = 'roberta-mlm'
- # token cls
- token_classification = 'token-classification'
- # extraction
- information_extraction = 'information-extraction'
-
-
- class Pipelines(object):
- """ Names for different pipelines.
-
- Holds the standard pipline name to use for identifying different pipeline.
- This should be used to register pipelines.
-
- For pipeline which support different models and implements the common function, we
- should use task name for this pipeline.
- For pipeline which suuport only one model, we should use ${Model}-${Task} as its name.
- """
- # vision tasks
- portrait_matting = 'unet-image-matting'
- image_denoise = 'nafnet-image-denoise'
- person_image_cartoon = 'unet-person-image-cartoon'
- ocr_detection = 'resnet18-ocr-detection'
- action_recognition = 'TAdaConv_action-recognition'
- animal_recognition = 'resnet101-animal-recognition'
- general_recognition = 'resnet101-general-recognition'
- cmdssl_video_embedding = 'cmdssl-r2p1d_video_embedding'
- hicossl_video_embedding = 'hicossl-s3dg-video_embedding'
- body_2d_keypoints = 'hrnetv2w32_body-2d-keypoints_image'
- body_3d_keypoints = 'canonical_body-3d-keypoints_video'
- hand_2d_keypoints = 'hrnetv2w18_hand-2d-keypoints_image'
- human_detection = 'resnet18-human-detection'
- object_detection = 'vit-object-detection'
- easycv_detection = 'easycv-detection'
- easycv_segmentation = 'easycv-segmentation'
- face_2d_keypoints = 'mobilenet_face-2d-keypoints_alignment'
- salient_detection = 'u2net-salient-detection'
- image_classification = 'image-classification'
- face_detection = 'resnet-face-detection-scrfd10gkps'
- ulfd_face_detection = 'manual-face-detection-ulfd'
- facial_expression_recognition = 'vgg19-facial-expression-recognition-fer'
- retina_face_detection = 'resnet50-face-detection-retinaface'
- mog_face_detection = 'resnet101-face-detection-cvpr22papermogface'
- mtcnn_face_detection = 'manual-face-detection-mtcnn'
- live_category = 'live-category'
- general_image_classification = 'vit-base_image-classification_ImageNet-labels'
- daily_image_classification = 'vit-base_image-classification_Dailylife-labels'
- image_color_enhance = 'csrnet-image-color-enhance'
- virtual_try_on = 'virtual-try-on'
- image_colorization = 'unet-image-colorization'
- image_style_transfer = 'AAMS-style-transfer'
- image_super_resolution = 'rrdb-image-super-resolution'
- face_image_generation = 'gan-face-image-generation'
- product_retrieval_embedding = 'resnet50-product-retrieval-embedding'
- realtime_object_detection = 'cspnet_realtime-object-detection_yolox'
- face_recognition = 'ir101-face-recognition-cfglint'
- image_instance_segmentation = 'cascade-mask-rcnn-swin-image-instance-segmentation'
- image2image_translation = 'image-to-image-translation'
- live_category = 'live-category'
- video_category = 'video-category'
- ocr_recognition = 'convnextTiny-ocr-recognition'
- image_portrait_enhancement = 'gpen-image-portrait-enhancement'
- image_to_image_generation = 'image-to-image-generation'
- skin_retouching = 'unet-skin-retouching'
- tinynas_classification = 'tinynas-classification'
- tinynas_detection = 'tinynas-detection'
- crowd_counting = 'hrnet-crowd-counting'
- action_detection = 'ResNetC3D-action-detection'
- video_single_object_tracking = 'ostrack-vitb-video-single-object-tracking'
- image_panoptic_segmentation = 'image-panoptic-segmentation'
- video_summarization = 'googlenet_pgl_video_summarization'
- image_semantic_segmentation = 'image-semantic-segmentation'
- image_reid_person = 'passvitb-image-reid-person'
- text_driven_segmentation = 'text-driven-segmentation'
- movie_scene_segmentation = 'resnet50-bert-movie-scene-segmentation'
- shop_segmentation = 'shop-segmentation'
- video_inpainting = 'video-inpainting'
- pst_action_recognition = 'patchshift-action-recognition'
- hand_static = 'hand-static'
-
- # nlp tasks
- sentence_similarity = 'sentence-similarity'
- word_segmentation = 'word-segmentation'
- part_of_speech = 'part-of-speech'
- named_entity_recognition = 'named-entity-recognition'
- text_generation = 'text-generation'
- text2text_generation = 'text2text-generation'
- sentiment_analysis = 'sentiment-analysis'
- sentiment_classification = 'sentiment-classification'
- text_classification = 'text-classification'
- fill_mask = 'fill-mask'
- fill_mask_ponet = 'fill-mask-ponet'
- csanmt_translation = 'csanmt-translation'
- nli = 'nli'
- dialog_intent_prediction = 'dialog-intent-prediction'
- dialog_modeling = 'dialog-modeling'
- dialog_state_tracking = 'dialog-state-tracking'
- zero_shot_classification = 'zero-shot-classification'
- text_error_correction = 'text-error-correction'
- plug_generation = 'plug-generation'
- faq_question_answering = 'faq-question-answering'
- conversational_text_to_sql = 'conversational-text-to-sql'
- table_question_answering_pipeline = 'table-question-answering-pipeline'
- sentence_embedding = 'sentence-embedding'
- passage_ranking = 'passage-ranking'
- relation_extraction = 'relation-extraction'
- document_segmentation = 'document-segmentation'
- feature_extraction = 'feature-extraction'
-
- # audio tasks
- sambert_hifigan_tts = 'sambert-hifigan-tts'
- speech_dfsmn_aec_psm_16k = 'speech-dfsmn-aec-psm-16k'
- speech_frcrn_ans_cirm_16k = 'speech_frcrn_ans_cirm_16k'
- speech_dfsmn_kws_char_farfield = 'speech_dfsmn_kws_char_farfield'
- kws_kwsbp = 'kws-kwsbp'
- asr_inference = 'asr-inference'
-
- # multi-modal tasks
- image_captioning = 'image-captioning'
- multi_modal_embedding = 'multi-modal-embedding'
- generative_multi_modal_embedding = 'generative-multi-modal-embedding'
- visual_question_answering = 'visual-question-answering'
- visual_grounding = 'visual-grounding'
- visual_entailment = 'visual-entailment'
- multi_modal_similarity = 'multi-modal-similarity'
- text_to_image_synthesis = 'text-to-image-synthesis'
- video_multi_modal_embedding = 'video-multi-modal-embedding'
- image_text_retrieval = 'image-text-retrieval'
-
-
- class Trainers(object):
- """ Names for different trainer.
-
- Holds the standard trainer name to use for identifying different trainer.
- This should be used to register trainers.
-
- For a general Trainer, you can use EpochBasedTrainer.
- For a model specific Trainer, you can use ${ModelName}-${Task}-trainer.
- """
-
- default = 'trainer'
- easycv = 'easycv'
-
- # multi-modal trainers
- clip_multi_modal_embedding = 'clip-multi-modal-embedding'
-
- # cv trainers
- image_instance_segmentation = 'image-instance-segmentation'
- image_portrait_enhancement = 'image-portrait-enhancement'
- video_summarization = 'video-summarization'
- movie_scene_segmentation = 'movie-scene-segmentation'
-
- # nlp trainers
- bert_sentiment_analysis = 'bert-sentiment-analysis'
- dialog_modeling_trainer = 'dialog-modeling-trainer'
- dialog_intent_trainer = 'dialog-intent-trainer'
- nlp_base_trainer = 'nlp-base-trainer'
- nlp_veco_trainer = 'nlp-veco-trainer'
- nlp_passage_ranking_trainer = 'nlp-passage-ranking-trainer'
-
- # audio trainers
- speech_frcrn_ans_cirm_16k = 'speech_frcrn_ans_cirm_16k'
-
-
- class Preprocessors(object):
- """ Names for different preprocessor.
-
- Holds the standard preprocessor name to use for identifying different preprocessor.
- This should be used to register preprocessors.
-
- For a general preprocessor, just use the function name as preprocessor name such as
- resize-image, random-crop
- For a model-specific preprocessor, use ${modelname}-${fuction}
- """
-
- # cv preprocessor
- load_image = 'load-image'
- image_denoie_preprocessor = 'image-denoise-preprocessor'
- image_color_enhance_preprocessor = 'image-color-enhance-preprocessor'
- image_instance_segmentation_preprocessor = 'image-instance-segmentation-preprocessor'
- image_portrait_enhancement_preprocessor = 'image-portrait-enhancement-preprocessor'
- video_summarization_preprocessor = 'video-summarization-preprocessor'
- movie_scene_segmentation_preprocessor = 'movie-scene-segmentation-preprocessor'
-
- # nlp preprocessor
- sen_sim_tokenizer = 'sen-sim-tokenizer'
- cross_encoder_tokenizer = 'cross-encoder-tokenizer'
- bert_seq_cls_tokenizer = 'bert-seq-cls-tokenizer'
- text_gen_tokenizer = 'text-gen-tokenizer'
- text2text_gen_preprocessor = 'text2text-gen-preprocessor'
- token_cls_tokenizer = 'token-cls-tokenizer'
- ner_tokenizer = 'ner-tokenizer'
- nli_tokenizer = 'nli-tokenizer'
- sen_cls_tokenizer = 'sen-cls-tokenizer'
- dialog_intent_preprocessor = 'dialog-intent-preprocessor'
- dialog_modeling_preprocessor = 'dialog-modeling-preprocessor'
- dialog_state_tracking_preprocessor = 'dialog-state-tracking-preprocessor'
- sbert_token_cls_tokenizer = 'sbert-token-cls-tokenizer'
- zero_shot_cls_tokenizer = 'zero-shot-cls-tokenizer'
- text_error_correction = 'text-error-correction'
- sentence_embedding = 'sentence-embedding'
- passage_ranking = 'passage-ranking'
- sequence_labeling_tokenizer = 'sequence-labeling-tokenizer'
- word_segment_text_to_label_preprocessor = 'word-segment-text-to-label-preprocessor'
- fill_mask = 'fill-mask'
- fill_mask_ponet = 'fill-mask-ponet'
- faq_question_answering_preprocessor = 'faq-question-answering-preprocessor'
- conversational_text_to_sql = 'conversational-text-to-sql'
- table_question_answering_preprocessor = 'table-question-answering-preprocessor'
- re_tokenizer = 're-tokenizer'
- document_segmentation = 'document-segmentation'
- feature_extraction = 'feature-extraction'
-
- # audio preprocessor
- linear_aec_fbank = 'linear-aec-fbank'
- text_to_tacotron_symbols = 'text-to-tacotron-symbols'
- wav_to_lists = 'wav-to-lists'
- wav_to_scp = 'wav-to-scp'
-
- # multi-modal preprocessor
- ofa_tasks_preprocessor = 'ofa-tasks-preprocessor'
- mplug_tasks_preprocessor = 'mplug-tasks-preprocessor'
-
-
- class Metrics(object):
- """ Names for different metrics.
- """
-
- # accuracy
- accuracy = 'accuracy'
- audio_noise_metric = 'audio-noise-metric'
-
- # metrics for image denoise task
- image_denoise_metric = 'image-denoise-metric'
-
- # metric for image instance segmentation task
- image_ins_seg_coco_metric = 'image-ins-seg-coco-metric'
- # metrics for sequence classification task
- seq_cls_metric = 'seq-cls-metric'
- # metrics for token-classification task
- token_cls_metric = 'token-cls-metric'
- # metrics for text-generation task
- text_gen_metric = 'text-gen-metric'
- # metrics for image-color-enhance task
- image_color_enhance_metric = 'image-color-enhance-metric'
- # metrics for image-portrait-enhancement task
- image_portrait_enhancement_metric = 'image-portrait-enhancement-metric'
- video_summarization_metric = 'video-summarization-metric'
- # metric for movie-scene-segmentation task
- movie_scene_segmentation_metric = 'movie-scene-segmentation-metric'
-
-
- class Optimizers(object):
- """ Names for different OPTIMIZER.
-
- Holds the standard optimizer name to use for identifying different optimizer.
- This should be used to register optimizer.
- """
-
- default = 'optimizer'
-
- SGD = 'SGD'
-
-
- class Hooks(object):
- """ Names for different hooks.
-
- All kinds of hooks are defined here
- """
- # lr
- LrSchedulerHook = 'LrSchedulerHook'
- PlateauLrSchedulerHook = 'PlateauLrSchedulerHook'
- NoneLrSchedulerHook = 'NoneLrSchedulerHook'
-
- # optimizer
- OptimizerHook = 'OptimizerHook'
- TorchAMPOptimizerHook = 'TorchAMPOptimizerHook'
- ApexAMPOptimizerHook = 'ApexAMPOptimizerHook'
- NoneOptimizerHook = 'NoneOptimizerHook'
-
- # checkpoint
- CheckpointHook = 'CheckpointHook'
- BestCkptSaverHook = 'BestCkptSaverHook'
-
- # logger
- TextLoggerHook = 'TextLoggerHook'
- TensorboardHook = 'TensorboardHook'
-
- IterTimerHook = 'IterTimerHook'
- EvaluationHook = 'EvaluationHook'
-
-
- class LR_Schedulers(object):
- """learning rate scheduler is defined here
-
- """
- LinearWarmup = 'LinearWarmup'
- ConstantWarmup = 'ConstantWarmup'
- ExponentialWarmup = 'ExponentialWarmup'
-
-
- class Datasets(object):
- """ Names for different datasets.
- """
- ClsDataset = 'ClsDataset'
- Face2dKeypointsDataset = 'Face2dKeypointsDataset'
- SegDataset = 'SegDataset'
- DetDataset = 'DetDataset'
- DetImagesMixDataset = 'DetImagesMixDataset'
|