-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef29e1a
commit 3076947
Showing
175 changed files
with
122 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
minestudio/benchmark/auto_eval/task_configs/simple/build_dig3fill1.yaml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
''' | ||
Date: 2024-12-06 16:42:49 | ||
LastEditors: zhengxinyue | ||
LastEditTime: 2024-12-11 17:44:10 | ||
FilePath: /MineStudio/minestudio/benchmark/read_conf.py | ||
''' | ||
import os | ||
import yaml | ||
|
||
def convert_yaml_to_callbacks(yaml_file): | ||
with open(yaml_file, 'r') as f: | ||
data = yaml.safe_load(f) | ||
commands = data.get('custom_init_commands', []) | ||
commands_callback = f"{commands}" | ||
|
||
text = data.get('text', '') | ||
task_name = os.path.splitext(os.path.basename(yaml_file))[0] | ||
task_callback = ( | ||
f"{{'name': '{task_name}', 'text': '{text}'}}" | ||
) | ||
|
||
return commands_callback, task_callback |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
minestudio/benchmark/task_configs/simple/build_dig3fill1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
custom_init_commands: | ||
- /give @s minecraft:dirt 15 | ||
- /give @s minecraft:stone_shovel | ||
defaults: | ||
- base | ||
- _self_ | ||
text: Build a 3x3 area filled with dirt blocks. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
''' | ||
Date: 2024-12-06 16:35:39 | ||
LastEditors: zhengxinyue | ||
LastEditTime: 2024-12-11 17:47:25 | ||
FilePath: /MineStudio/minestudio/benchmark/test.py | ||
''' | ||
import sys | ||
sys.path.append('/home/user/code/MineStudio/') | ||
import os | ||
import ray | ||
from rich import print | ||
from minestudio.inference import EpisodePipeline, MineGenerator, InfoBaseFilter | ||
from minestudio.benchmark.read_conf import convert_yaml_to_callbacks | ||
from functools import partial | ||
from minestudio.models import load_openai_policy | ||
from minestudio.simulator import MinecraftSim | ||
from minestudio.simulator.callbacks import ( | ||
SpeedTestCallback, | ||
RecordCallback, | ||
SummonMobsCallback, | ||
MaskActionsCallback, | ||
RewardsCallback, | ||
CommandsCallback, | ||
TaskCallback, | ||
FastResetCallback | ||
) | ||
|
||
import pdb | ||
|
||
|
||
if __name__ == '__main__': | ||
ray.init() | ||
conf_path = './task_configs/simple' | ||
|
||
for file_name in os.listdir(conf_path): | ||
if file_name.endswith('.yaml'): | ||
file_path = os.path.join(conf_path, file_name) | ||
commands_callback, task_callback = convert_yaml_to_callbacks(file_path) | ||
|
||
env = MinecraftSim( | ||
obs_size=(128, 128), | ||
preferred_spawn_biome="forest", | ||
callbacks=[ | ||
RecordCallback(record_path=f"./output/{file_name}", fps=30, frame_type="pov"), | ||
CommandsCallback(commands_callback), | ||
TaskCallback(task_callback), | ||
] | ||
) | ||
# pdb.set_trace() | ||
policy = load_openai_policy( | ||
model_path="/nfs-shared/jarvisbase/pretrained/foundation-model-2x.model", | ||
weights_path="/nfs-shared/jarvisbase/pretrained/foundation-model-2x.weights" | ||
).to("cuda") | ||
|
||
memory = None | ||
obs, info = env.reset() | ||
for i in range(1200): | ||
action, memory = policy.get_action(obs, memory, input_shape='*') | ||
obs, reward, terminated, truncated, info = env.step(action) | ||
env.close() | ||
|
||
|
||
|
||
|
||
|
||
|
||
|