-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More SUT options in CLI #548
Conversation
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
elif annotators: | ||
if max_tokens is not None or temp is not None or top_p is not None or top_k is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch.
self._validate_file() | ||
|
||
def __iter__(self) -> Iterable[PromptWithContext]: | ||
with open(self.path, newline="") as f: | ||
csvreader = csv.DictReader(f) | ||
for row in csvreader: | ||
yield PromptWithContext( | ||
prompt=TextPrompt(text=row["Text"]), | ||
prompt=TextPrompt(text=row["Text"], options=self.sut_options), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems a little weird to me to have to set this for each prompt given that it's stable across the run, but I guess that's the object model we have for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
@@ -66,6 +68,33 @@ def test_run_sut_demos(sut): | |||
assert re.search(r"Native response:", result.output) | |||
|
|||
|
|||
@patch("modelgauge.suts.demo_01_yes_no_sut.DemoYesNoSUT.translate_text_prompt") | |||
def test_run_sut_with_options(mock_translate_text_prompt): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff. These CLI tests are kind of a pain to write, but I'm glad to see it.
run-sut
andrun-csv-items
CLI commands now accept--temp
,--max_tokens
,--top-p
, and--top-k
.