Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Add JGLUE/JSQuAD evaluation (#66)
* Add JSQuAD notebook * Create preparation script * Change file name * Implements prompt and evaluation code * Implementes batch inference * Implements few-shot * Implements command * Change parameter * Update arguments --------- Co-authored-by: Takahiro Kubo <ttaakkaa@amazon.co.jp>
- Loading branch information
1 parent
5fd3228
commit 313409e
Showing
12 changed files
with
3,432 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
tasks/generative-ai/text-to-text/evaluation/lm-evaluation-harness/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
data/ | ||
scripts/ |
Empty file.
25 changes: 25 additions & 0 deletions
25
tasks/generative-ai/text-to-text/evaluation/lm-evaluation-harness/entrypoint.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import subprocess | ||
# import sagemaker_ssh_helper | ||
# sagemaker_ssh_helper.setup_and_start_ssh() | ||
|
||
import argparse | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument( | ||
"--model", type=str, default="rinna/japanese-gpt-neox-3.6b-instruction-ppo" | ||
) | ||
parser.add_argument("--peft", type=str) | ||
parser.add_argument("--task", type=str, default="jsquad-1.1-0.4") | ||
parser.add_argument("--num_fewshot", type=int, default=2) | ||
args = parser.parse_args() | ||
|
||
|
||
subprocess.run("chmod -R 777 /opt/ml/", shell=True) | ||
|
||
peft = ",peft=/opt/ml/input/data/train" if args.peft else "" | ||
|
||
model_args = f"pretrained={args.model}{peft},use_fast=False" | ||
|
||
start_cmd = f"python main.py --model hf-causal-experimental --model_args {model_args} --tasks '{args.task}' --num_fewshot '{int(args.num_fewshot)}' --device 'cuda' --output_path '/opt/ml/model/result.json'" | ||
|
||
subprocess.run(start_cmd, shell=True) |
Oops, something went wrong.