Unverified Commit e9a40543 authored by nicho2's avatar nicho2 Committed by GitHub
Browse files

correction bug EleutherAI#1664 (#1670)

* correction bug EleutherAI#1664

* add any invalid characters for Windows filenames and Unix-like systems

see:
https://gist.github.com/doctaphred/d01d05291546186941e1b7ddc02034d3?permalink_comment_id=3958715



* Update lm_eval/__main__.py

* Update scripts/zeno_visualize.py

* fix format

---------
Co-authored-by: default avatarHailey Schoelkopf <65563625+haileyschoelkopf@users.noreply.github.com>
Co-authored-by: default avatarhaileyschoelkopf <hailey@eleuther.ai>
parent 27924d77
...@@ -388,7 +388,8 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None: ...@@ -388,7 +388,8 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
if args.log_samples: if args.log_samples:
for task_name, config in results["configs"].items(): for task_name, config in results["configs"].items():
output_name = "{}_{}".format( output_name = "{}_{}".format(
re.sub("/|=", "__", args.model_args), task_name re.sub(r"[\"<>:/\|\\?\*\[\]]+", "__", args.model_args),
task_name,
) )
filename = path.joinpath(f"{output_name}.jsonl") filename = path.joinpath(f"{output_name}.jsonl")
samples_dumped = json.dumps( samples_dumped = json.dumps(
......
...@@ -67,7 +67,7 @@ def main(): ...@@ -67,7 +67,7 @@ def main():
# Upload data for all models # Upload data for all models
for model_index, model in enumerate(models): for model_index, model in enumerate(models):
model_args = re.sub( model_args = re.sub(
"/|=", r"[\"<>:/\|\\?\*\[\]]+",
"__", "__",
json.load( json.load(
open(Path(args.data_path, model, "results.json"), encoding="utf-8") open(Path(args.data_path, model, "results.json"), encoding="utf-8")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment