Updated LeetExecutor

This commit is contained in:
Beck LaBash 2023-04-11 21:00:05 -04:00
parent b579fd61e0
commit c52741524c
3 changed files with 13 additions and 4 deletions

View File

@ -4,8 +4,7 @@ from .py_executor import PyExecutor
from .rs_executor import RsExecutor
from .leet_executor import LeetExecutor
from .executor_types import Executor
from .executor_utils import PySubmissionFormatter, RsSubmissionFormatter
from .leetcode_env.leetcode_env.utils import PySubmissionFormatter, RsSubmissionFormatter
def executor_factory(lang: str, is_leet: bool = False) -> Executor:
if lang == "py" or lang == "python":

View File

@ -1,7 +1,7 @@
from typing import List
from .executor_types import ExecuteResult, Executor
from .executor_utils import SubmissionFormatter
from .leetcode_env.leetcode_env.utils import SubmissionFormatter
from .leetcode_env.leetcode_env.environment import LeetCodeEnv
from .leetcode_env.leetcode_env.leetcode_types import ProgrammingLanguage, LeetCodeSubmission
@ -21,7 +21,7 @@ class LeetExecutor(Executor):
submission = LeetCodeSubmission(
code = self.formatter.to_leetcode(func),
lang = self.lang,
question_id = id_from_slug(name),
question_id = id_from_slug(name, self.env.api_instance),
question_slug = name,
timeout = timeout
)

10
run_simple_py_leet.sh Executable file
View File

@ -0,0 +1,10 @@
python main.py \
--run_name "simple_leetcode_python3" \
--root_dir "root" \
--dataset_path ./executors/leetcode_env/leetcode_dataset/data/humaneval/leetcode-hard-py-40-uncontaminated.jsonl \
--strategy "simple" \
--language "py" \
--model "gpt-4" \
--pass_at_k "1" \
--max_iters "1" \
--verbose