sotopia-lab / sotopia

Sotopia: an Open-ended Social Learning Environment (ICLR 2024 spotlight)
https://docs.sotopia.world
MIT License
164 stars 20 forks source link

[BUG]: LLMChain requires to implement abstract methods #52

Closed Jasonqi146 closed 5 months ago

Jasonqi146 commented 7 months ago

Description of the bug

LLMChain class seems to require more implementation in generate.py/obtain_chain()

sotopia/sotopia/generation_utils/generate.py(336)obtain_chain() -> chain = LLMChain(llm=chat, prompt=chat_prompt_template) (Pdb) n pydantic.error_wrappers.ValidationError: 1 validation error for LLMChain llm Can't instantiate abstract class BaseLanguageModel with abstract methods agenerate_prompt, apredict, apredict_messages, generate_prompt, invoke, predict, predict_messages (type=type_error) sotopia/sotopia/generation_utils/generate.py(336)obtain_chain() -> chain = LLMChain(llm=chat, prompt=chat_prompt_template)

Steps To Reproduce

  1. Follow the instructions in README to set up Redis and python environment.
  2. Insert pdb.set_trace() to line 335 at generate.py before chain = LLMChain(llm=chat, prompt=chat_prompt_template)
  3. In terminal run python examples/minimalist_demo.py
  4. press n at the breakpoint

Additional Information

No response

Jasonqi146 commented 7 months ago

This issue could be resolved by installing the dev options, however not by installing sotopia directly.

ProKil commented 6 months ago

@Jasonqi146 Did you use the poetry install method or the pip install sotopia method?

Jasonqi146 commented 6 months ago

I used pip install sotopia

ProKil commented 5 months ago

Is this still a bug with the latest sotopia version?

ProKil commented 5 months ago

Closing this issue due to no response from the OP. Feel free to reopen if the problem still exists.