diff --git a/eland/ml/pytorch/transformers.py b/eland/ml/pytorch/transformers.py index bad24d8..770e4f7 100644 --- a/eland/ml/pytorch/transformers.py +++ b/eland/ml/pytorch/transformers.py @@ -1059,5 +1059,8 @@ def elasticsearch_model_id(model_id: str) -> str: id = re.sub(r"[\s\\/]", "__", model_id).lower()[-64:] if id.startswith("__"): - id = id.removeprefix("__") + # This check is only needed as long as Eland supports Python 3.8 + # str.removeprefix was introduced in Python 3.9 and can be used + # once 3.8 support is dropped + id = id[2:] return id