mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-02 19:21:31 +06:00
Small Fix to modular converter (#34051)
* small_fix * supporting both src/tranformers and examples/ * make style
This commit is contained in:
parent
211f1d93db
commit
24b82f3cd5
@ -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)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user