forked from MineDojo/Voyager
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathevaluate.py
29 lines (25 loc) · 1.25 KB
/
evaluate.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from shared import fetch_credentials
from questllama.extensions.chat_interaction_provider import QuestllamaClientProvider
from shared.config import USE_QUESTLLAMA
from _voyager.extensions.chat_provider import VoyagerChatProvider
from _voyager import Voyager
if __name__ == "__main__":
# Get login credentials and launch the experiment.
azure_login, openai_api_key = fetch_credentials()
# Determine which client provider to use based on configuration
chat_provider_class = (
QuestllamaClientProvider if USE_QUESTLLAMA else VoyagerChatProvider
)
# First instantiate Voyager with skill_library_dir.
voyager = Voyager(
chat_provider=chat_provider_class,
azure_login=azure_login,
openai_api_key=openai_api_key,
skill_library_dir="questllama/skill_library/trial1/", # Load a learned skill library.
ckpt_dir="runs/demo", # Feel free to use a new dir. Do not use the same dir as skill library because new events will still be recorded to ckpt_dir.
resume=False, # Do not resume from a skill library because this is not learning.
)
# Run task decomposition
task = "Craft 1 wooden pickaxe."
sub_goals = voyager.decompose_task(task=task)
voyager.inference(sub_goals=sub_goals)