mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-17 15:35:21 +02:00
update: add path check
This commit is contained in:
parent
e81339f0b0
commit
d9cd6f6866
1 changed files with 5 additions and 3 deletions
|
|
@ -2,6 +2,7 @@
|
|||
# @Date : 2023/9/23 14:14
|
||||
# @Author : stellahong (stellahong@fuzhi.ai)
|
||||
# @Desc :
|
||||
import os
|
||||
from typing import Iterable, Dict, Any
|
||||
from pydantic import BaseModel, Field
|
||||
import requests
|
||||
|
|
@ -497,9 +498,10 @@ class MinecraftPlayer(SoftwareCompany):
|
|||
"wait_ticks": 20,
|
||||
}
|
||||
)
|
||||
with open(f"{CKPT_DIR}/curriculum/round_id.json", "r") as f:
|
||||
|
||||
round_id = json.load(f)["last_round_id"]
|
||||
## add resume round_id
|
||||
if os.path.exists(f"{CKPT_DIR}/curriculum/round_id.json"):
|
||||
with open(f"{CKPT_DIR}/curriculum/round_id.json", "r") as f:
|
||||
round_id = json.load(f)["last_round_id"]
|
||||
else:
|
||||
# clear the inventory
|
||||
self.game_memory.mf_instance.reset(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue