I am getting this error on langchain

try this one:

from langchain_huggingface.llms.huggingface_endpoint import HuggingFaceEndpoint
llm = HuggingFaceEndpoint(
    task='text-generation',
    model="deepseek-ai/DeepSeek-R1",
    max_new_tokens=100,
    temperature=0.7,
    huggingfacehub_api_token="your_api"
)
print(llm.invoke("What is the capital of Turkey"))
1 Like