8000 GitHub - whydumb/Voyager: An Open-Ended Embodied Agent with Large Language Models
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

whydumb/Voyager

 
 

Repository files navigation

Voyager: An Open-Ended Embodied Agent with Large Language Models

우리는 마인크래프트에서 세계를 지속적으로 탐험하고, 다양한 기술을 습득하며, 인간의 개입 없이 새로운 발견을 하는 최초의 LLM 기반 평생 학습 에이전트인 Voyager를 소개합니다. Voyager는 다음의 세 가지 핵심 구성 요소로 이루어져 있습니다:

탐험을 극대화하는 자동 커리큘럼,

복잡한 행동을 저장하고 호출할 수 있는 실행 가능한 코드로 구성된 지속적으로 확장되는 스킬 라이브러리,

환경 피드백, 실행 오류, 자기 검증을 통합하여 프로그램을 개선하는 새로운 반복적 프롬프트 메커니즘.

Voyager는 GPT-4와 블랙박스 쿼리를 통해 상호작용하므로 모델 파라미터 튜닝이 필요하지 않습니다. Voyager가 개발한 기술은 시간적으로 확장 가능하고 해석 가능하며, 구성 요소별로 결합되어 에이전트의 능력을 빠르게 확장하고, 재학습에 따른 망각을 줄여줍니다. 실험 결과, Voyager는 강력한 맥락 내 평생 학습 능력을 보여주며 마인크래프트에서 탁월한 능숙함을 보였습니다.

Voyager는 기존 최첨단 기술보다 3.3배 더 많은 고유 아이템을 얻고, 2.3배 더 긴 거리를 여행하며, 기술 트리의 주요 단계를 최대 15.3배 더 빠르게 달성합니다. Voyager는 학습된 스킬 라이브러리를 새로운 마인크래프트 세계에서도 활용하여 새로운 작업을 처음부터 해결할 수 있으며, 다른 기술들은 이러한 일반화에 어려움을 겪습니다.

In this repo, we provide Voyager code. This codebase is under MIT License.

Installation

Voyager는 Python 3.9 이상과 Node.js 16.13.0 이상이 필요합니다. 우리는 Ubuntu 20.04, Windows 11, macOS에서 테스트를 완료했습니다. Voyager를 설치하려면 아래 지침을 따르세요.

Python Install

git clone https://github.com/MineDojo/Voyager
cd Voyager
pip install -e .

Node.js Install

In addition to the Python dependencies, you need to install the following Node.js packages:

cd voyager/env/mineflayer
npm install -g npx
npm install
cd mineflayer-collectblock
npx tsc
cd ..
npm install

Minecraft Instance Install

Voyager depends on Minecraft game. You need to install Minecraft game and set up a Minecraft instance.

Follow the instructions in Minecraft Login Tutorial to set up your Minecraft Instance.

Fabric Mods Install

You need to install fabric mods to support all the features in Voyager. Remember to use the correct Fabric version of all the mods.

Follow the instructions in Fabric Mods Install to install the mods.

Getting Started

Voyager uses OpenAI's GPT-4 as the language model. You need to have an OpenAI API key to use Voyager. You can get one from here.

After the installation process, you can run Voyager by:

from voyager import Voyager

# You can also use mc_port instead of azure_login, but azure_login is highly recommended
azure_login = {
    "client_id": "YOUR_CLIENT_ID",
    "redirect_url": "https://127.0.0.1/auth-response",
    "secret_value": "[OPTIONAL] YOUR_SECRET_VALUE",
    "version": "fabric-loader-0.14.18-1.19", # the version Voyager is tested on
}
openai_api_key = "YOUR_API_KEY"

voyager = Voyager(
    azure_login=azure_login,
    openai_api_key=openai_api_key,
)

# start lifelong learning
voyager.learn()
  • If you are running with Azure Login for the first time, it will ask you to follow the command line instruction to generate a config file.
  • For Azure Login, you also need to select the world and open the world to LAN by yourself. After you run voyager.learn() the game will pop up soon, you need to:
    1. Select Singleplayer and press Create New World.
    2. Set Game Mode to Creative and Difficulty to Peaceful.
    3. After the world is created, press Esc key and press Open to LAN.
    4. Select Allow cheats: ON and press Start LAN World. You will see the bot join the world soon.

Resume from a checkpoint during learning

If you stop the learning process and want to resume from a checkpoint later, you can instantiate Voyager by:

from voyager import Voyager

voyager = Voyager(
    azure_login=azure_login,
    openai_api_key=openai_api_key,
    ckpt_dir="YOUR_CKPT_DIR",
    resume=True,
)

Run Voyager for a specific task with a learned skill library

If you want to run Voyager for a specific task with a learned skill library, you should first pass the skill library directory to Voyager:

from voyager import Voyager

# First instantiate Voyager with skill_library_dir.
voyager = Voyager(
    azure_login=azure_login,
    openai_api_key=openai_api_key,
    skill_library_dir="./skill_library/trial1", # Load a learned skill library.
    ckpt_dir="YOUR_CKPT_DIR", # 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.
)

Then, you can run task decomposition. Notice: Occasionally, the task decomposition may not be logical. If you notice the printed sub-goals are flawed, you can rerun the decomposition.

# Run task decomposition
task = "YOUR TASK" # e.g. "Craft a diamond pickaxe"
sub_goals = voyager.decompose_task(task=task)

Finally, you can run the sub-goals with the learned skill library:

voyager.inference(sub_goals=sub_goals)

For all valid skill libraries, see Learned Skill Libraries.

FAQ

If you have any questions, please check our FAQ first before opening an issue.

Paper and Citation

If you find our work useful, please consider citing us!

@article{wang2023voyager,
  title   = {Voyager: An Open-Ended Embodied Agent with Large Language Models},
  author  = {Guanzhi Wang and Yuqi Xie and Yunfan Jiang and Ajay Mandlekar and Chaowei Xiao and Yuke Zhu and Linxi Fan and Anima Anandkumar},
  year    = {2023},
  journal = {arXiv preprint arXiv: Arxiv-2305.16291}
}

Disclaimer: This project is strictly for research purposes, and not an official product from NVIDIA.

About

An Open-Ended Embodied Agent with Large Language Models

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 66.5%
  • Python 33.5%
0