forked from mst272/LLM-Dojo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
165 additions
and
257 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
torch_dtype = ['bf16', 'fp16'] | ||
task_name = ['humaneval'] | ||
|
||
|
||
@dataclass | ||
class EvaluateArgs: | ||
""" | ||
|
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,43 @@ | ||
|
||
class TaskUtils: | ||
def __init__(self): | ||
self.IMPORT_HELPER = { | ||
"python": [ | ||
"import math", | ||
"import re", | ||
"import sys", | ||
"import copy", | ||
"import datetime", | ||
"import itertools", | ||
"import collections", | ||
"import heapq", | ||
"import functools", | ||
"import hashlib", | ||
"import numpy", | ||
"import numpy as np", | ||
"import string", | ||
"from typing import *", | ||
"from collections import *", | ||
] | ||
} | ||
|
||
@staticmethod | ||
def build_instruction(example): | ||
""" | ||
根据模型构建合适的指令 | ||
""" | ||
return example['prompt'] | ||
|
||
@staticmethod | ||
def generation_code_process(example): | ||
""" | ||
对生成的代码提取函数部分 及 设置import等操作 | ||
""" | ||
pass | ||
|
||
@staticmethod | ||
def return_test_code(sample): | ||
""" | ||
返回最终进行运行测试code | ||
""" | ||
pass |
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
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
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
from transformers import HfArgumentParser | ||
import os | ||
from args import EvaluateArgs | ||
from task import humaneval | ||
|
||
parser = HfArgumentParser((EvaluateArgs,)) | ||
args = parser.parse_args_into_dataclasses()[0] | ||
os.environ["TOKENIZERS_PARALLELISM"] = "false" | ||
|
||
TASKS = { | ||
"humaneval": humaneval.HumanEval | ||
} | ||
|
||
task = TASKS[args.task_name] | ||
|
||
if not args.generate_only: | ||
generate_main(args) |
Oops, something went wrong.