Large modular logic refactoring (#34487)
* rework converter * Update modular_model_converter.py * Update modular_model_converter.py * Update modular_model_converter.py * Update modular_model_converter.py * cleaning * cleaning * finalize imports * imports * Update modular_model_converter.py * Better renaming to avoid visiting same file multiple times * start converting files * style * address most comments * style * remove unused stuff in get_needed_imports * style * move class dependency functions outside class * Move main functions outside class * style * Update modular_model_converter.py * rename func * add augmented dependencies * Update modular_model_converter.py * Add types_to_file_type + tweak annotation handling * Allow assignment dependency mapping + fix regex * style + update modular examples * fix modular_roberta example (wrong redefinition of __init__) * slightly correct order in which dependencies will appear * style * review comments * Performance + better handling of dependencies when they are imported * style * Add advanced new classes capabilities * style * add forgotten check * Update modeling_llava_next_video.py * Add prority list ordering in check_conversion as well * Update check_modular_conversion.py * Update configuration_gemma.py
This commit is contained in:
@@ -4,6 +4,8 @@ import glob
|
||||
import logging
|
||||
from io import StringIO
|
||||
|
||||
from create_dependency_mapping import find_priority_list
|
||||
|
||||
# Console for rich printing
|
||||
from modular_model_converter import convert_modular_file
|
||||
from rich.console import Console
|
||||
@@ -69,7 +71,7 @@ if __name__ == "__main__":
|
||||
if args.files == ["all"]:
|
||||
args.files = glob.glob("src/transformers/models/**/modular_*.py", recursive=True)
|
||||
non_matching_files = 0
|
||||
for modular_file_path in args.files:
|
||||
for modular_file_path in find_priority_list(args.files):
|
||||
non_matching_files += compare_files(modular_file_path, args.fix_and_overwrite)
|
||||
|
||||
if non_matching_files and not args.fix_and_overwrite:
|
||||
|
||||
Reference in New Issue
Block a user