Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/instructlab/eval/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,15 @@ class ModelServingAPIError(EvalError):
def __init__(self) -> None:
super().__init__()
self.message = "Failed to receive a reply from model serving API."


class EmptyTaxonomyError(EvalError):
"""
Error raised when taxonomy doesn't contain any skill QNAs
Attributes
message error message to be printed on raise
"""

def __init__(self) -> None:
super().__init__()
self.message = "Provided taxonomy doesn't contain any skill qna.yaml files"
9 changes: 8 additions & 1 deletion src/instructlab/eval/mt_bench_branch_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@
import yaml

# Local
from .exceptions import GitRepoNotFoundError, InvalidGitBranchError, InvalidGitRepoError
from .exceptions import (
EmptyTaxonomyError,
GitRepoNotFoundError,
InvalidGitBranchError,
InvalidGitRepoError,
)
from .logger_config import setup_logger
from .mt_bench_common import bench_dir

Expand Down Expand Up @@ -57,6 +62,8 @@ def generate(judge_model_name, branch, taxonomy_dir, output_dir):
taxonomy_repo.git.checkout(branch)

qna_file_list = get_file_paths(taxonomy_dir)
if len(qna_file_list) == 0:
raise EmptyTaxonomyError

question_lst = []
reference_answers = []
Expand Down