Skip to content

Commit

Permalink
Merge pull request #88 from bcrochet/ignore-knowledge
Browse files Browse the repository at this point in the history
fix: mt_bench_branch should ignore knowledge in generate
  • Loading branch information
nathan-weinberg authored Aug 1, 2024
2 parents 4c020b6 + 3147c75 commit d272c80
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 d272c80

Please sign in to comment.