Fix model bug and push (#35)

This commit is contained in:
you-n-g
2024-06-27 18:15:31 +08:00
committed by GitHub
parent f25ef70c98
commit bc8d96e96c
3 changed files with 38 additions and 10 deletions
@@ -1,3 +1,4 @@
import re
from typing import Sequence
from rdagent.oai.llm_utils import APIBackend
@@ -36,7 +37,8 @@ class ModelTaskGen(TaskGenerator):
)
# Extract the code part from the response
code = resp.split("```python")[1].split("```")[0]
match = re.search(r".*```[Pp]ython\n(.*)\n```.*", resp, re.DOTALL)
code = match.group(1)
mti.inject_code(**{"model.py": code})
mti_l.append(mti)
return mti_l