-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel_utils.py
More file actions
29 lines (21 loc) · 815 Bytes
/
model_utils.py
File metadata and controls
29 lines (21 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""
Model name utilities for handling progress markers via model suffix.
This module provides utilities for parsing model names to determine
whether progress markers should be shown based on the -progress suffix.
"""
from typing import Tuple
import logging
logger = logging.getLogger(__name__)
class ModelUtils:
"""Utilities for handling model names and progress markers."""
@classmethod
def extract_progress_flag(cls, model: str) -> Tuple[str, bool]:
"""Extract progress flag from model name.
Args:
model: Model name potentially ending with -progress
Returns:
Tuple of (base model name, has progress flag)
"""
if model.endswith("-progress"):
return model[:-9], True
return model, False