Skip to content

Commit

Permalink
Small Fix to modular converter (huggingface#34051)
Browse files Browse the repository at this point in the history
* small_fix

* supporting both src/tranformers and examples/

* make style
  • Loading branch information
MekkCyber authored Oct 10, 2024
1 parent 211f1d9 commit 24b82f3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utils/modular_model_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1088,8 +1088,9 @@ def convert_modular_file(modular_file, old_model_name=None, new_model_name=None,
if node != {}:
# Get relative path starting from src/transformers/
relative_path = re.search(
f"{os.sep}(src{os.sep}transformers{os.sep}.*)", os.path.abspath(modular_file)
rf"(src{os.sep}transformers{os.sep}.*|examples{os.sep}.*)", os.path.abspath(modular_file)
).group(1)

header = AUTO_GENERATED_MESSAGE.format(
relative_path=relative_path, short_name=os.path.basename(relative_path)
)
Expand Down

0 comments on commit 24b82f3

Please sign in to comment.