Introduction aux grands modèles de langue (LLM)

Introduction aux LLM avec Python

Jasmin Ludolf

Senior Data Science Content Developer, DataCamp

Connaissances préalables

  • Naviguer dans le Hub Hugging Face
  • Modèles d'apprentissage profond

Dessin d'un cerveau lisant un livre

Introduction aux LLM avec Python

Introduction aux LLM

 

Icône d'une ampoule et d'un cerveau pour illustrer la compréhension

Introduction aux LLM avec Python

Introduction aux LLM

 

Illustration d'un portable pour représenter l'utilisation

Introduction aux LLM avec Python

Illustration abstraite d'un grand modèle de langue

Introduction aux LLM avec Python

Illustration abstraite d'un grand modèle de langue avec une bulle « résumer »

Introduction aux LLM avec Python

Illustration abstraite d'un grand modèle de langue avec des bulles « résumer » et « générer »

Introduction aux LLM avec Python

Illustration abstraite d'un grand modèle de langue avec des bulles « résumer », « générer » et « traduire »

Introduction aux LLM avec Python

Illustration abstraite d'un grand modèle de langue avec des bulles « résumer », « générer », « traduire », « questions-réponses »

Logos de LLM

Introduction aux LLM avec Python

LLM

 

  • Fondés sur des architectures d'apprentissage profond

 

  • Le plus souvent des transformers

 

  • Énormes réseaux de neurones avec beaucoup de paramètres et de texte

Logo de Hugging Face

Introduction aux LLM avec Python

Utiliser des modèles 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 : supprimer les espaces superflus
Introduction aux LLM avec Python

Sorties du modèle

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
Introduction aux LLM avec Python

À venir

 

  • Consolider vos connaissances sur les LLM
  • Réaliser de nouvelles tâches
  • Voir comment les LLM sont conçus
  • Adapter des LLM (fine-tuning)
  • Évaluer la performance des LLM

Parcours d'apprentissage

Introduction aux LLM avec Python

Passons à la pratique !

Introduction aux LLM avec Python

Preparing Video For Download...