ChatHuggingFace Example Code

#4
by gulnuravci - opened

Hello! Since this space was linked under the ChatHuggingFace in the Hugging Face x LangChain : A new partner package in LangChain article, I thought it would be appropriate to raise this here :D

I am building a Unity game where I need to integrate conversation, but am having trouble getting the example code on the article to work for me:
image.png
but when I run it, I get a 422 input error at the invoke line (using endpoint for meta-llama/Meta-Llama-3-8B-Instruct). What could I be missing? ๐Ÿค”๐Ÿ’ญ

I ended up answering my own question, but dropping here for viz incase anyone runs into the same thing:
Via https://api.python.langchain.com/en/latest/llms/langchain_huggingface.llms.huggingface_endpoint.HuggingFaceEndpoint.html:
To use this class, you should have installed the huggingface_hub package, and the environment variable HUGGINGFACEHUB_API_TOKEN set with your API token, or given as a named parameter to the constructor.

Sign up or log in to comment