MCPcopy
hub / github.com/huggingface/transformers / get_models_in_diff

Function get_models_in_diff

utils/check_modular_conversion.py:126–141  ·  view source on GitHub ↗

Finds all models that have been modified in the diff. Returns: A set containing the names of the models that have been modified (e.g. {'llama', 'whisper'}).

()

Source from the content-addressed store, hash-verified

124
125
126def get_models_in_diff():
127 """
128 Finds all models that have been modified in the diff.
129
130 Returns:
131 A set containing the names of the models that have been modified (e.g. {'llama', 'whisper'}).
132 """
133 modified_files = _get_modified_files()
134
135 # Matches both modelling files and tests
136 relevant_modified_files = [x for x in modified_files if "/models/" in x and x.endswith(".py")]
137 model_names = set()
138 for file_path in relevant_modified_files:
139 model_name = file_path.split("/")[-2]
140 model_names.add(model_name)
141 return model_names
142
143
144def converter_changed_in_diff():

Callers 1

Calls 3

_get_modified_filesFunction · 0.85
splitMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected