🤖

macOSでface bookのhabitat-llm, partnr-planner

に公開

facebookのembodied aiの研究開発成果としてhabitat-sim, habitat-labが公開されている。
https://aihabitat.org/docs/habitat-sim/

これらの継続したプロジェクトとして、LLMをagentとして言語的な指示をもとに使用するべきtoolsを判断し、次にするべき行動を選択するhabitat-llmを公開している。
さらに、そのエージェントが複数で相互作用するマルチージェントベースライン環境として、partnr-plannerを公開している。
https://github.com/facebookresearch/partnr-planner/tree/main
かっこいいサイトはこっち
https://aihabitat.org/partnr/

また、こちらはICLR2025で発表されている。

趣味で動かしてみたが、INSTALLATION.md見てるだけだと詰まった.
のでインストールに必要なコマンドを勝手に整理。
PR出した方が親切かな??

mamba create -n habitat-llm python=3.9.2 cmake=3.18.4 -c conda-forge -y
mamba activate habitat-llm
mamba install pytorch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1 pybullet -c pytorch -c conda-forge -y
mamba install habitat-sim withbullet -c conda-forge -c aihabitat -y

若干公式と違うけどここまでは順調。

次エラーがあり。

pip install -e ./third_party/habitat-lab/habitat-lab
~中略~
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
habitat-sim 0.3.3 requires pillow==10.4.0, but you have pillow 8.4.0 which is incompatible.
~略~

となるので

pip install pillow==10.4.0

する。もう一回pip install -e ./third_party/habitat-lab/habitat-labして問題ないこと確認する。

続きやってく。

pip install -e ./third_party/habitat-lab/habitat-baselines
pip install -e ./third_party/transformers-CFG

事前にrequirments.txtでprotbufのバージョンを4.25.2に書き換えておく。
競合することが複数回の検証でわかっている。ので事前に更新。

pip install -r requirements.txt

で問題ない。
あとはgit cloneやリンカやら実行して。

python -m pytest habitat_llm/tests

をやるが動かない。
弊環境はM4 macbook proでapple siliconである。cudaしか使えない実装が邪魔して使えないところがあるので修正。

if device is cudaのところの条件を厳しくする。

もう一回実行してみる。
今度はopenaiのライブラリが古いんだって。
APIに渡すべき引数にproxieとかあって古い。

pip install openai -U

でopenaiのAPIを最新にする。
どこで古くなってんのか知らんが、見ればわかるが。

あとはcudaを使うようにしているパラメータをcpuにする必要もあった。
(mpsにしてもいいかもしれない)

device: cuda -> cpu

これでpartnr_plannerのopenaiのサンプルファイルが動くようになった。
README.mdのopenai backendのところ。

python -m habitat_llm.examples.planner_demo --config-name baselines/single_agent_zero_shot_react_summary.yaml \
habitat.dataset.data_path="data/datasets/partnr_episodes/v0_0/val_mini.json.gz" \
llm@evaluation.agents.agent_0.planner.plan_config.llm=openai_chat

他のサンプルも試さなきゃ。

Discussion