Using an LLM

LLMs can be used as-is (i.e., out-of-the-box) or after fine-tuning.

Hugging Face model cards will generally provide code for how to get started. Code may be PyTorch or TensorFlow, “raw” (using the model directly), or pipeline code (using the pipeline from transformers library).

  • Ex 1
    • provides “raw” PyTorch code
  • Ex 2
    • provides pipeline code

Code for at least loading the model (directly and using the pipeline) is provided by clicking the “Use this model” button on Hugging Face. You may have to dig through the links to find the code you need.

Previous
Next
RC Logo © 2025 The Rector and Visitors of the University of Virginia