mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
Fix Issue 1549 & Fix Claude Token Calculate Error.
This commit is contained in:
parent
beae28d365
commit
ea13d7a351
2 changed files with 11 additions and 2 deletions
|
|
@ -72,7 +72,12 @@ def parse_args():
|
|||
parser.add_argument("--max_rounds", type=int, default=20, help="Max iteration rounds")
|
||||
parser.add_argument("--check_convergence", type=bool, default=True, help="Whether to enable early stop")
|
||||
parser.add_argument("--validation_rounds", type=int, default=5, help="Validation rounds")
|
||||
parser.add_argument("--if_first_optimize", type=bool, default=True, help="Whether it's the first optimization")
|
||||
parser.add_argument(
|
||||
"--if_first_optimize",
|
||||
type=lambda x: x.lower() == "true",
|
||||
default=True,
|
||||
help="Whether to download dataset for the first time",
|
||||
)
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,11 @@ class DataUtils:
|
|||
def load_results(self, path: str) -> list:
|
||||
result_path = os.path.join(path, "results.json")
|
||||
if os.path.exists(result_path):
|
||||
return read_json_file(result_path, encoding="utf-8")
|
||||
with open(result_path, "r") as json_file:
|
||||
try:
|
||||
return json.load(json_file)
|
||||
except json.JSONDecodeError:
|
||||
return []
|
||||
return []
|
||||
|
||||
def get_top_rounds(self, sample: int, path=None, mode="Graph"):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue