Skip to content

Commit

Permalink
fix: debug dsagent (#387)
Browse files Browse the repository at this point in the history
* basic dsagent & debug

debug dsagent

change dsagent conf

* Refine changes

* Update vector_base.py
  • Loading branch information
taozhiwang authored Sep 29, 2024
1 parent f2a6e75 commit 8fe9511
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 2 additions & 0 deletions rdagent/app/kaggle/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,7 @@ class Config:

auto_submit: bool = True

dsagent: bool = False


KAGGLE_IMPLEMENT_SETTING = KaggleBasePropSetting()
1 change: 0 additions & 1 deletion rdagent/components/proposal/model_proposal.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def gen(self, trace: Trace) -> ModelHypothesis:
.from_string(ModelHypothesisGen.prompts["hypothesis_gen"]["user_prompt"])
.render(
targets="feature engineering and model building",
hypothesis_and_feedback=context_dict["hypothesis_and_feedback"],
RAG=context_dict["RAG"],
)
)
Expand Down
7 changes: 1 addition & 6 deletions rdagent/components/proposal/prompts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,9 @@ hypothesis_gen:
{{ hypothesis_output_format }}
user_prompt: |-
{% if hypothesis_and_feedback|length == 0 %}It is the first round of hypothesis generation. The user has no hypothesis on this scenario yet.
{% else %}It is not the first round, the user has made several hypothesis on this scenario and did several evaluation on them.
The former hypothesis and the corresponding feedbacks are as follows (focus on the last one & the new hypothesis that it provides and reasoning to see if you agree):
{{ hypothesis_and_feedback }}
{% endif %}
{% if RAG %}To help you generate new {{targets}}, we have prepared the following information for you:
{{ RAG }}{% endif %}
Please generate the new hypothesis based on the information above. Also generate the relevant keys for the reasoning and the distilled knowledge that follows. For those keys, in particular for knowledge, explain in the context of the specific scenario to build up domain knowledge in the specific field rather than general knowledge.
Also generate the relevant keys for the reasoning and the distilled knowledge that follows. For those keys, in particular for knowledge, explain in the context of the specific scenario to build up domain knowledge in the specific field rather than general knowledge.
hypothesis2experiment:
system_prompt: |-
Expand Down
5 changes: 4 additions & 1 deletion rdagent/scenarios/kaggle/proposal/proposal.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ def __init__(self, scen: Scenario) -> Tuple[dict, bool]:

def generate_RAG_content(self, trace: Trace, hypothesis_and_feedback: str) -> str:
if self.scen.if_using_vector_rag:
rag_results, _ = self.scen.vector_base.search_experience(hypothesis_and_feedback, topk_k=5)
if self.scen.dsagent:
rag_results, _ = self.scen.dsagent.vector_base.search_experience(hypothesis_and_feedback, topk_k=1)
else:
rag_results, _ = self.scen.vector_base.search_experience(hypothesis_and_feedback, topk_k=5)
return "\n".join([doc.content for doc in rag_results])
if self.scen.if_using_graph_rag is False or trace.knowledge_base is None:
return None
Expand Down

0 comments on commit 8fe9511

Please sign in to comment.