[Python] Langchain ChatOllama().invoke() produced error: AttributeError: 'ModelPrivateAttr'...

Discussão em 'Python' iniciado por Stack, Setembro 17, 2024.

  1. Stack

    Stack Membro Participativo

    I used the following code to test if the ChatOllama() is working for me

    from langchain_ollama import ChatOllama

    chatmodel = ChatOllama(
    model="mistral:latest" # also tried model = 'mistral'
    )

    response_message = chatmodel.invoke("Tell me a joke")


    However, I received the following error message AttributeError: 'ModelPrivateAttr' object has no attribute 'chat'

    Not sure what went wrong

    Before running the above python code, I did verify the Ollama server is on and I was able to run the Ollama model in my terminal:

    [​IMG]

    Continue reading...

Compartilhe esta Página