Skip to content

Commit a477b3b

Browse files
committed
Workaround HPU dependency on specific transformers version
Signed-off-by: Sergey Plotnikov <[email protected]>
1 parent 84b62f1 commit a477b3b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/training_hub/profiling/memory_estimator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from typing import override
22
from transformers import AutoModel
3-
from mini_trainer.osft_utils import MODEL_CONFIGS
43
import numpy as np
54

65
"""
@@ -322,6 +321,9 @@ def __init__(
322321
raise ValueError("Ratio must be in the range [0, 1]")
323322

324323
# Check to see which terms need to be included in the search for valid layers
324+
# MODEL_CONFIGS require transformers>4.56.0, that conflict with HPU enabling,
325+
# temporary moving MODEL_CONFIGS import here to enable HPU support
326+
from mini_trainer.osft_utils import MODEL_CONFIGS
325327
self.target_terms = MODEL_CONFIGS['default']['patterns']
326328
for key in MODEL_CONFIGS.keys():
327329
if self.model_path.find(key) > -1:

0 commit comments

Comments
 (0)