Skip to content

Commit

Permalink
Updated expected patterns for NeMo prompt test
Browse files Browse the repository at this point in the history
  • Loading branch information
jkosek committed Sep 5, 2023
1 parent 92b9dee commit 2918cbe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.

# Changelog

## 0.3.0 (2023-09-01)
## 0.3.0 (2023-09-05)

- new: Support for multiple Python versions starting from 3.8+
- new: Added support for [decoupled models](https://github.com/triton-inference-server/server/blob/main/docs/user_guide/decoupled_models.md) enabling to support streaming models (alpha state)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,18 @@ def verify_client_output(client_output):
else:
LOGGER.info(f'Found "{expected_pattern}" in client output')

expected_patterns = [r"neutral", r"set the alarm", r"seven am"]
for expected_pattern in expected_patterns:
output_match = re.search(expected_pattern, client_output, re.MULTILINE)
output_array = output_match.group(0) if output_match else None
if not output_array:
raise ValueError(f"Could not find {expected_pattern} in client output. Output: {client_output}")
# NeMo model might return neutral or positive sentiment for given task - both are acceptable in test
expected_patterns = [[r"neutral", r"positive"], [r"set the alarm"], [r"seven am"]]
for patterns in expected_patterns:
matches = [re.search(pattern, client_output, re.MULTILINE) for pattern in patterns]
output_array = [match.group(0) if match else None for match in matches]

if not any(output_array):
raise ValueError(
f'Could not find any of patterns "{", ".join(patterns)}" in client output. Output: {client_output}'
)
else:
LOGGER.info(f'Found "{expected_pattern}" in client output')
LOGGER.info(f'Found at least one of patterns "{", ".join(patterns)}" in client output')


def main():
Expand Down

0 comments on commit 2918cbe

Please sign in to comment.