Hugging Face Local Pipelines
Hugging Face models can be run locally through the HuggingFacePipeline
class.
The Hugging Face Model Hub hosts over 120k models, 20k datasets, and 50k demo apps (Spaces), all open source and publicly available, in an online platform where people can easily collaborate and build ML together.
These can be called from LangChain either through this local pipeline wrapper or by calling their hosted inference endpoints through the HuggingFaceHub class.
To use, you should have the transformers
python package installed, as well as pytorch. You can also install xformer
for a more memory-efficient attention implementation.
%pip install --upgrade --quiet transformers