Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't instantiate abstract class BaseLanguageModel #10

Open
nasirus opened this issue Apr 10, 2023 · 1 comment
Open

Can't instantiate abstract class BaseLanguageModel #10

nasirus opened this issue Apr 10, 2023 · 1 comment

Comments

@nasirus
Copy link
Owner

nasirus commented Apr 10, 2023

I'm receiving this error when I try to call:

OutputFixingParser.from_llm(parser=parser, llm=ChatOpenAI())

Where parser is a class that I have built to extend BaseOutputParser. I don't think that class can be the problem because of the error I am receiving:

File "pydantic/main.py", line 341, in pydantic.main.BaseModel.init
pydantic.error_wrappers.ValidationError: 1 validation error for LLMChain
Can't instantiate abstract class BaseLanguageModel with abstract methods agenerate_prompt, generate_prompt (type=type_error)

@nasirus
Copy link
Owner Author

nasirus commented Apr 10, 2023

Hi there,

Thank you for bringing this issue to our attention. It looks like you are trying to instantiate an abstract class, BaseLanguageModel, which is not allowed. Abstract classes are classes that contain one or more abstract methods. Abstract methods are methods that are declared, but contain no implementation.

In order to fix this issue, you will need to create a concrete class that extends BaseLanguageModel and implements the abstract methods. You can find more information about abstract classes and methods in the Python documentation.

I hope this helps! Let me know if you have any other questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant