Introduzione ai Large Language Model (LLM)

Introduzione agli LLM in Python

Jasmin Ludolf

Senior Data Science Content Developer, DataCamp

Conoscenze pregresse

  • Navigare l'Hugging Face Hub
  • Modelli di deep learning

Cervello fumetto che legge un libro

Introduzione agli LLM in Python

Introduzione agli LLM

 

Icona di lampadina e cervello per rappresentare la comprensione

Introduzione agli LLM in Python

Introduzione agli LLM

 

Illustrazione di un laptop per rappresentare l'uso

Introduzione agli LLM in Python

Illustrazione astratta di un large language model

Introduzione agli LLM in Python

Illustrazione astratta di un large language model con una bolla "riassumi"

Introduzione agli LLM in Python

Illustrazione astratta di un large language model con una bolla "riassumi" e "genera"

Introduzione agli LLM in Python

Illustrazione astratta di un large language model con una bolla "riassumi", "genera" e "traduci"

Introduzione agli LLM in Python

Illustrazione astratta di un large language model con una bolla "riassumi", "genera", "traduci", "Q&A"

Loghi LLM

Introduzione agli LLM in Python

LLM

 

  • Basati su architetture di deep learning

 

  • Più comuni: i transformer

 

  • Enormi reti neurali con molti parametri e testi

Logo Hugging Face

Introduzione agli LLM in Python

Usare i modelli di Hugging Face

from transformers import pipeline


summarizer = pipeline(task="summarization", model="facebook/bart-large-cnn")
text = "Walking amid Gion's Machiya wooden houses is a mesmerizing experience. The beautifully preserved structures exuded an old-world charm that transports visitors back in time, making them feel like they had stepped into a living museum. The glow of lanterns lining the narrow streets add to the enchanting ambiance, making each stroll a memorable journey through Japan's rich cultural history." summary = summarizer(text, max_length=50)
  • clean_up_tokenization_spaces=True: rimuove spazi superflui
Introduzione agli LLM in Python

Output del modello

print(summary)
[{'summary_text': "Gion's Machiya
  wooden houses exuded an old-world 
  charm that transports visitors back 
  in time. The glow of lanterns lining 
  the narrow streets add to the 
  enchanting ambiance, making each 
  stroll a memorable journey through 
  Japan's"}]
print(summary[0]["summary_text"])
Gion's Machiya wooden houses exuded an 
old-world charm that transports 
visitors back in time. The glow of 
lanterns lining the narrow streets add 
to the enchanting ambiance, making each 
stroll a memorable journey through 
Japan's
Introduzione agli LLM in Python

In arrivo

 

  • Ampliare le conoscenze sugli LLM
  • Svolgere nuovi task
  • Capire come sono costruiti gli LLM
  • Fine-tuning degli LLM
  • Valutare le prestazioni degli LLM

Percorso di apprendimento

Introduzione agli LLM in Python

Ayo berlatih!

Introduzione agli LLM in Python

Preparing Video For Download...