Skip to content

Commit f7d66b0

Browse files
committed
add type hint, simplify method by using abc.abstractmethod
1 parent a32a1c7 commit f7d66b0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/modelgauge/dynamic_sut.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from abc import ABC, abstractmethod
2+
13
from modelgauge.secret_values import InjectSecret
24
from modelgauge.sut import SUT
35

@@ -27,14 +29,15 @@ class DynamicSUT(SUT):
2729
pass
2830

2931

30-
class DynamicSUTMaker:
32+
class DynamicSUTMaker(ABC):
3133

3234
@staticmethod
35+
@abstractmethod
3336
def get_secrets() -> InjectSecret:
34-
raise NotImplementedError("SUTMaker.get_secrets must be implemented by child classes.")
37+
pass
3538

3639
@staticmethod
37-
def parse_sut_name(name: str):
40+
def parse_sut_name(name: str) -> tuple[str, str, str, str]:
3841
"""A dynamic SUT name looks like hf/nebius/google/gemma-3-27b-it
3942
hf = proxy (passes requests through to...)
4043
provider = nebius (runs model by...)
@@ -71,5 +74,6 @@ def extract_model_name(name: str) -> str:
7174
return model
7275

7376
@staticmethod
77+
@abstractmethod
7478
def find(name: str):
75-
raise NotImplementedError("DynamicSUTMaker.find must be implemented by child classes.")
79+
pass

0 commit comments

Comments
 (0)