Skip to content

Commit

Permalink
v2 wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike authored and the-crypt-keeper committed Jul 29, 2023
1 parent 6956127 commit 3e1a22e
Show file tree
Hide file tree
Showing 11 changed files with 170 additions and 55 deletions.
2 changes: 1 addition & 1 deletion bulk-eval.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

if [ "$1" == "" ]; then
GLOB="results/interview_junior*.ndjson"
GLOB="results-v2/interview_junior*.ndjson"
else
GLOB="$1/interview_junior*.ndjson"
fi
Expand Down
50 changes: 25 additions & 25 deletions compare-v2/compare-codecherrypop-javascript.json

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions compare-v2/compare-codecherrypop-python.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def analysis(data, analyser):

return data

def main(config: str, path: str = "results/", analyser: str = "", language: str = "javascript,python"):
def main(config: str, path: str = "results-v2/", analyser: str = "", language: str = "javascript,python"):
cfg = yaml.safe_load(open(config))

for lang in language.split(','):
Expand Down
2 changes: 1 addition & 1 deletion evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def evaluation(test, language, code):

if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Interview evaluator')
parser.add_argument('--interview', type=str, default='junior-dev', help='interview to evaluate')
parser.add_argument('--interview', type=str, default='junior-v2', help='interview to evaluate')
parser.add_argument('--input', type=str, required=True, help='path to interview*.ndjson')
parser.add_argument('--test', type=str, help='(optional) specific test to evaluate')
parser.add_argument('--stopcomment', action='store_true', help='(optional) stop code extraction at first comment')
Expand Down
3 changes: 3 additions & 0 deletions junior-v2/gcd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
gcd_5_0:
assert: "f.call(5,0)"
eq: 5
gcd_0_3:
assert: "f.call(0,3)"
eq: 3
gcd_13_7:
assert: "f.call(13,7)"
eq: 1
Expand Down
6 changes: 3 additions & 3 deletions prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from jinja2 import Template
from pathlib import Path

def load_questions(interview='junior-dev'):
def load_questions(interview='junior-v2'):
module_dir = os.path.dirname(os.path.abspath(__file__))
for file_path in glob.glob(module_dir+'/'+interview+'/*.yaml'):
with open(file_path, 'r') as file:
Expand All @@ -34,14 +34,14 @@ def save_interview(input, templateout, params, model, results):
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Interview preparation')
parser.add_argument('--language', type=str, default='python,javascript', help='languages to prepare, comma seperated')
parser.add_argument('--interview', type=str, default='junior-dev', help='interview to prepare')
parser.add_argument('--interview', type=str, default='junior-v2', help='interview to prepare')
parser.add_argument('--template', type=str, required=True, help='prompt template file')
args = parser.parse_args()

template = Template(open(args.template).read())
template_name = Path(args.template).stem

output_filename = f"results/prepare_{args.interview}_{args.language.replace(',', '-')}_{template_name}.ndjson"
output_filename = f"results-v2/prepare_{args.interview}_{args.language.replace(',', '-')}_{template_name}.ndjson"
outputs = []
for test in load_questions(interview=args.interview):
for language in args.language.split(','):
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit 3e1a22e

Please sign in to comment.