From 6dc9f42ece2edfb35fe1b6cde932817ca064e20c Mon Sep 17 00:00:00 2001 From: femto Date: Mon, 17 Feb 2025 16:57:30 +0800 Subject: [PATCH] deepseek-r1 --- examples/smart_minion/aime/aime_config.json | 1 - examples/smart_minion/aime/evalute_aime.py | 1 + minion/main/prompt.py | 7 +++++ minion/main/worker.py | 31 ++++++++++----------- 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/examples/smart_minion/aime/aime_config.json b/examples/smart_minion/aime/aime_config.json index fb7bdb8c..0e4c8cbc 100644 --- a/examples/smart_minion/aime/aime_config.json +++ b/examples/smart_minion/aime/aime_config.json @@ -1,6 +1,5 @@ { "type": "ensemble", - "pre_processing": ["problem_reflect","example_reasoning"], "workers": [ { "name": "raw", diff --git a/examples/smart_minion/aime/evalute_aime.py b/examples/smart_minion/aime/evalute_aime.py index 571a1c1e..a63db4e6 100644 --- a/examples/smart_minion/aime/evalute_aime.py +++ b/examples/smart_minion/aime/evalute_aime.py @@ -225,6 +225,7 @@ async def solve_question(item): #model = "gpt-4o" #model = "claude" model = "deepseek-r1" +#model = "phi-4" llm = create_llm_provider(config.models.get(model)) cost_manager = CostManager() diff --git a/minion/main/prompt.py b/minion/main/prompt.py index 700ca13c..e0090d83 100644 --- a/minion/main/prompt.py +++ b/minion/main/prompt.py @@ -7,12 +7,19 @@ ASK_PROMPT_JINJA = """ Current Problem: +{%- if input.short_context %} context: {{input.short_context}} +{%- endif %} +{%- if input.instruction %} instruction: {{input.instruction}} +{%- endif %} +{%- if input.query_type %} query_type: {{input.query_type}} +{%- endif %} + query: {{input.query}} """ diff --git a/minion/main/worker.py b/minion/main/worker.py index 51110dec..690258cf 100644 --- a/minion/main/worker.py +++ b/minion/main/worker.py @@ -70,6 +70,21 @@ class WorkerMinion(Minion): pass +class RawMinion(WorkerMinion): + """Raw minion that directly queries LLM without any prompt processing or modifications""" + + def __init__(self, **kwargs): + super().__init__(**kwargs) + self.input.instruction = "" + + async def execute(self): + node = LmpActionNode(self.brain.llm) + response = await node.execute(self.input.query) + + self.answer_raw = self.input.answer_raw = response + self.answer = self.input.answer = response + return self.answer + @register_worker_minion class NativeMinion(WorkerMinion): """native minion, directly asks llm for answer""" @@ -1003,22 +1018,6 @@ async def execute(self): self.answer = self.input.answer = response return self.answer -class RawMinion(WorkerMinion): - """Raw minion that directly queries LLM without any prompt processing or modifications""" - - def __init__(self, **kwargs): - super().__init__(**kwargs) - self.input.instruction = "" - - async def execute(self): - node = LmpActionNode(self.brain.llm) - response = await node.execute(self.input.query) - - self.raw_answer = self.input.answer_raw = response - self.answer = self.input.answer = response - return self.answer - -