Add model like (#14992)
* Add new model like command * Bad doc-styler * black and doc-styler, stop fighting! * black and doc-styler, stop fighting! * At last * Clean up * Typo * Bad doc-styler * Bad doc-styler * All good maybe? * Use constants * Add doc and type hints * More cleaning * Add doc * Fix Copied from * Doc template * Use typing.Pattern instead * Framework-specific files * Fixes * Select frameworks clean model init * Deal with frameworks in main init * fixes * Last fix * Prompt user for info * Delete exemple config * Last fixes * Add test config * Fix bug with model_type included in each other * Fixes * More fixes * More fixes * Adapt config * Remove print statements * Will fix tokenization later, leave it broken for now * Add test * Quality * Try this way * Debug * Maybe by setting the path? * Let's try another way * It should go better when actually passing the arg... * Remove debug statements and style * Fix config * Add tests * Test require the three backends * intermediate commit * Revamp pattern replacements and start work on feature extractors * Adapt model info * Finalize code for processors * Fix in main init additions * Finish questionnaire for processing classes * Fix file name * Fix for real * Fix patterns * Style * Remove needless warnings * Copied from should work now. * Include Copied form in blocks * Add test * More fixes and tests * Apply suggestions from code review Co-authored-by: Lysandre Debut <lysandre@huggingface.co> * Address review comment Co-authored-by: Lysandre Debut <lysandre@huggingface.co>
This commit is contained in:
19
tests/fixtures/add_distilbert_like_config.json
vendored
Normal file
19
tests/fixtures/add_distilbert_like_config.json
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"add_copied_from": true,
|
||||
"old_model_type": "distilbert",
|
||||
"new_model_patterns": {
|
||||
"model_name": "BERT New",
|
||||
"checkpoint": "huggingface/bert-new-base",
|
||||
"model_type": "bert-new",
|
||||
"model_lower_cased": "bert_new",
|
||||
"model_camel_cased": "BertNew",
|
||||
"model_upper_cased": "BERT_NEW",
|
||||
"config_class": "BertNewConfig",
|
||||
"tokenizer_class": "DistilBertTokenizer"
|
||||
},
|
||||
"frameworks": [
|
||||
"pt",
|
||||
"tf",
|
||||
"flax"
|
||||
]
|
||||
}
|
||||
1342
tests/test_add_new_model_like.py
Normal file
1342
tests/test_add_new_model_like.py
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user