401 Client Error: Unauthorized for url: https://huggingface.co/api/whoami-v2

Here is the code:
from langchain_core.messages import (
HumanMessage,
SystemMessage,
)
from langchain_huggingface import ChatHuggingFace

messages = [
SystemMessage(content=“You’re a helpful assistant”),
HumanMessage(
content=“What happens when an unstoppable force meets an immovable object?”
),
]

chat_model = ChatHuggingFace(llm=llm)

1 Like