Employing LLMs from Hugging Face via Python
Now, we will review a code notebook that exemplifies implementing an open source LLM locally using Hugging Face’s free resources. We will continue with the same notebook from the previous section, Setting Up Close Source and Open Source LLMs:
- Install the required Python libraries: To freely work with Hugging Face’s open source models and other various resources, we need to install the necessary Python library.
Via
pip
on the Terminal, we will run the following:pip install –upgrade transformers
Alternatively, if running directly from a Jupyter notebook, add
!
to the beginning of the command. - Experiment with Microsoft’s DialoGPT-medium: This LLM is dedicated to conversational applications. It was generated by Microsoft and achieved high scores when compared to other LLMs on common benchmarks. For that reason, it is also quite popular on Hugging Face’s platform, in the sense that it is downloaded frequently...