Skip to content

Commit

Permalink
fix: mt_bench_branch should ignore knowledge in generate
Browse files Browse the repository at this point in the history
The mt_bench_branch currently only support pre-v3 yaml, and knowledge is
currently at v3. But knowledge should not even be included in the eval
run. This ignores the knowledge directory in order to skip it.

Signed-off-by: Brad P. Crochet <[email protected]>
  • Loading branch information
bcrochet committed Aug 1, 2024
1 parent 6914d27 commit 3147c75
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/instructlab/eval/mt_bench_branch_generator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
# Standard
from pathlib import Path
import hashlib
import json
import os
Expand All @@ -22,10 +23,20 @@
def get_file_paths(directory):
logger.debug(locals())
file_paths = []
for root, _, files in os.walk(directory):
for file in files:
if file.split("/")[-1] == "qna.yaml":
file_paths.append(os.path.join(root, file))
root_paths = [
entry
for entry in Path(directory).iterdir()
if entry.is_dir()
if not entry.name.startswith(".")
if entry.name != "knowledge"
if entry.name != "docs"
if entry.name != "scripts"
]
for basedir in root_paths:
for root, _, files in os.walk(basedir):
file_paths.extend(
[os.path.join(root, file) for file in files if file == "qna.yaml"]
)
return file_paths


Expand Down

0 comments on commit 3147c75

Please sign in to comment.