diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..2562c49e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "LLMDebugger"] + path = LLMDebugger + url = https://github.com/FloridSleeves/LLMDebugger.git diff --git a/LLMDebugger b/LLMDebugger new file mode 160000 index 00000000..49ac191f --- /dev/null +++ b/LLMDebugger @@ -0,0 +1 @@ +Subproject commit 49ac191f181d47911cf38e5b9944fbbe6d4a6e60 diff --git a/examples/smart_minion/brain.py b/examples/smart_minion/brain.py index 928df852..0918f870 100644 --- a/examples/smart_minion/brain.py +++ b/examples/smart_minion/brain.py @@ -29,8 +29,10 @@ async def smart_brain(): brain = Brain( python_env=RpycPythonEnv(port=python_env_config.get("port", 3007)), llm=llm, - #llms={"route": [ "llama3.2","llama3.1"]} + llms={"route": [ "llama3.2","llama3.1"]} ) + # obs, score, *_ = await brain.step(query="what's the solution for game of 24 for 4 3 9 8") + # print(obs) # 从 HumanEval/88 提取的测试用例 test_data = { diff --git a/examples/smart_minion/human_eval/evalute_human_eval_error.py b/examples/smart_minion/human_eval/evalute_human_eval_error.py index e1ea5d5d..7f42c0d7 100644 --- a/examples/smart_minion/human_eval/evalute_human_eval_error.py +++ b/examples/smart_minion/human_eval/evalute_human_eval_error.py @@ -304,7 +304,7 @@ async def main(): # 使用新的数据集运行评估 correct, count, matched_ids, mismatched_ids = await evaluate_dataset( mismatched_data, - run_filename=f"run_human_eval_test_{model}4.json", + run_filename=f"run_human_eval_test3_{model}2.json", continue_process=True, concurrency_count=60 ) diff --git a/examples/smart_minion/human_eval/human_eval_config.json b/examples/smart_minion/human_eval/human_eval_config.json index d149b9f3..e5e7a00d 100644 --- a/examples/smart_minion/human_eval/human_eval_config.json +++ b/examples/smart_minion/human_eval/human_eval_config.json @@ -5,7 +5,7 @@ { "name": "cot", "count": 1, - "check": true, + "check": 3, "post_processing": "extract_python" } ], diff --git a/minion/main/__init__.py b/minion/main/__init__.py index 1256ea58..dd16a059 100644 --- a/minion/main/__init__.py +++ b/minion/main/__init__.py @@ -1,5 +1,33 @@ -from . import minion -from . import worker -from . import check_route -from . import check +from minion.main.worker import ( + WorkerMinion, + NativeMinion, + CotMinion, + PythonMinion, + MathMinion, + PlanMinion, + MathPlanMinion, + MultiPlanMinion, + OptillmMinion, +) + +try: + from minion.main.ldb_worker import LDBMinion + HAS_LDB = True +except ImportError: + HAS_LDB = False + +__all__ = [ + 'WorkerMinion', + 'NativeMinion', + 'CotMinion', + 'PythonMinion', + 'MathMinion', + 'PlanMinion', + 'MathPlanMinion', + 'MultiPlanMinion', + 'OptillmMinion', +] + +if HAS_LDB: + __all__.append('LDBMinion') diff --git a/minion/main/input.py b/minion/main/input.py index 113ef4a7..0222cd90 100644 --- a/minion/main/input.py +++ b/minion/main/input.py @@ -15,6 +15,16 @@ from minion.utils.utils import extract_number_from_string from minion.utils.answer_extraction import extract_math_answer, extract_python +import os +import sys + +# 获取LLMDebugger/programming的绝对路径 +debugger_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'LLMDebugger', 'programming')) +sys.path.append(debugger_path) + +# 现在可以直接导入PyGenerator等模块 +from PyGenerator import xxx + class PostProcessingType(str, Enum): NONE = "none" diff --git a/requirements.txt b/requirements.txt index aa96a2ef..4a486752 100644 --- a/requirements.txt +++ b/requirements.txt @@ -27,3 +27,15 @@ antlr4-python3-runtime ell-ai optillm aiofiles + +#ldb dependencies +jsonlines==3.1.0 +datasets +astunparse +transformers +accelerate +astor +graphviz +#vllm +astroid +#ldb dependencies \ No newline at end of file