Skip to content

Commit

Permalink
Merge branch 'feat_math_sovler' of https://github.com/didiforgithub/M…
Browse files Browse the repository at this point in the history
…etaGPT into feat_math_sovler
  • Loading branch information
didiforgithub committed Apr 11, 2024
2 parents 269d19c + 2e1e408 commit 26a8e59
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion math_ai/codebase/engine/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def llm_response(self, prompt: str, model: str = "gpt-4-turbo", json_mode: bool
completion_tokens = usage.completion_tokens
if json_mode:
result = response.choices[0].message.content
result = json.loads(response.choices[0].message.content)
result = json.loads(result)
else:
result = response.choices[0].message.content
return result
Expand Down
16 changes: 9 additions & 7 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
# Author : Jiayi Zhang
# email : [email protected]
# Description: run math ai
import sys
import os
import asyncio

# add metagpt rootpath to syspath
meta_rootpath = os.getcwd()
if meta_rootpath not in sys.path:
sys.path.append(meta_rootpath)
# import sys
# import os
# meta_rootpath = os.getcwd()
# if meta_rootpath not in sys.path:
# sys.path.append(meta_rootpath)


import asyncio
from math_ai.codebase.gate_controller import GateController
from math_ai.codebase.math_resovler import MathResolver
from math_ai.codebase.data_processer import DataProcesser
Expand Down Expand Up @@ -39,5 +41,5 @@ async def main(question_path: str):
print(solutions)

if __name__ == '__main__':
question_path = '/Users/mac/Github_project/MathAI/math_ai/dataset/2021.json'
question_path = 'H:/Hack/Ali/dataset/2021.json'
asyncio.run(main(question_path))

0 comments on commit 26a8e59

Please sign in to comment.