Skip to content

Commit

Permalink
updating eval script
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishivi committed May 28, 2024
1 parent 45079d3 commit 78804dd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,4 @@ launcher/


beaker_configs/auto_created/*
*.jsonl
2 changes: 2 additions & 0 deletions beaker_configs/default_eval.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ tasks:
value: true
- name: OPENAI_API_KEY
secret: openai_api_key
- name: IS_ALPACA_EVAL_2
value: false
datasets:
- mountPath: /data/
source:
Expand Down
11 changes: 4 additions & 7 deletions scripts/submit_open_instruct_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
d1['tasks'][0]['constraints']['cluster'] = cluster
d1['tasks'][0]['context']['priority'] = args.priority
d1['tasks'][0]['resources']['gpuCount'] = 1

# Use a different image if requested.
if args.beaker_image is not None:
d1['tasks'][0]['image']['beaker'] = args.beaker_image
Expand Down Expand Up @@ -163,10 +162,8 @@
--tokenizer_name_or_path /model \
--n_shot 8 \
--use_chat_format \
--chat_formatting_function eval.templates.create_prompt_with_tulu_chat_format \
--chat_formatting_function eval.templates.create_prompt_with_tulu_chat_format
'''
if args.gsm_stop_at_double_newline:
task_spec['arguments'][0] += " --stop_at_double_newline"
elif experiment_group == "tydiqa_goldp_1shot":
task_spec["arguments"][0] = '''
python -m eval.tydiqa.run_eval \
Expand Down Expand Up @@ -290,10 +287,10 @@

if model_info[0].startswith("hf-"): # if it's a huggingface model, load it from the model hub
task_spec['arguments'] = [task_spec['arguments'][0].replace("--model_name_or_path /model", "--model_name_or_path "+model_info[1])]
task_spec['arguments'] = [task_spec['arguments'][0].replace("--tokenizer_name_or_path /model", "--tokenizer_name_or_path "+model_info[1])]
task_spec['arguments'] = [task_spec['arguments'][0].replace("--tokenizer_name_or_path /model", "--model_name_or_path "+model_info[1])]
elif model_info[1].startswith("/"): # if it's a local model, load it from the local directory
task_spec['arguments'] = [task_spec['arguments'][0].replace("--model_name_or_path /model", "--model_name_or_path "+model_info[1])]
task_spec['arguments'] = [task_spec['arguments'][0].replace("--tokenizer_name_or_path /model", "--tokenizer_name_or_path "+model_info[1])]
task_spec['arguments'] = [task_spec['arguments'][0].replace("--tokenizer_name_or_path /model", "--model_name_or_path "+model_info[1])]
else: # if it's a beaker model, mount the beaker dataset to `/model`
task_spec['datasets'][1]['source']['beaker'] = model_info[1]

Expand Down Expand Up @@ -402,4 +399,4 @@
file.close()

cmd = "beaker experiment create {} --workspace ai2/{}".format(fn, workspace)
subprocess.Popen(cmd, shell=True)
subprocess.Popen(cmd, shell=True)

0 comments on commit 78804dd

Please sign in to comment.