Qu'est-ce que Llama?

Travailler avec Llama 3

Imtihan Ahmed

Machine Learning Engineer

Faites connaissance avec l'instructeur

 

  • Imtihan Ahmed
  • Ingénieur(e) en Machine Learning
  • Six ans d'expérience
  • IA à grande échelle

  Photo du profil de l'instructeur

Travailler avec Llama 3

Qu'est-ce que Llama 3?

 

  • Résumé de texte

Capture d'écran 2025-02-19 à 11.01.25.png

Travailler avec Llama 3

Qu'est-ce que Llama 3?

 

  • Résumé de texte

 

  • Analyse de données

Capture d'écran 2025-02-19 à 11.01.16.png

Travailler avec Llama 3

Qu'est-ce que Llama 3?

 

  • Résumé de texte

 

  • Analyse de données

 

  • Assistant de code

Capture d'écran 2025-02-19 à 11.01.07.png

Travailler avec Llama 3

Qu'est-ce que Llama 3?

Capture d'écran 2025-02-19 à 11.32.24.png

Llama 3 :

  • Développé par Meta
Travailler avec Llama 3

Qu'est-ce que Llama 3?

Capture d'écran 2025-02-19 à 11.32.18.png

Llama 3 :

  • Développé par Meta
  • Génération de texte
Travailler avec Llama 3

Qu'est-ce que Llama 3?

Capture d'écran 2025-02-19 à 11.32.12.png

  • Développé par Meta
  • Génération de texte
  • Entraîné sur un vaste jeu de données
    • Équivalent à 2 000 Wikipédia
  • Code source ouvert
Travailler avec Llama 3

Pourquoi exécuter Llama 3 localement

  • Exemple : automatisation industrielle
    • Llama prévoit les besoins de maintenance

3.jpg

1 https://ai.meta.com/blog/aitomatic-built-with-llama/
Travailler avec Llama 3

Pourquoi exécuter Llama 3 localement

 

  • Vie privée et sécurité

Capture d'écran 2025-02-19 à 11.48.10.png

Travailler avec Llama 3

Pourquoi exécuter Llama 3 localement

 

  • Vie privée et sécurité

 

  • Efficience des coûts

Capture d'écran 2025-02-19 à 11.48.03.png

Travailler avec Llama 3

Pourquoi exécuter Llama 3 localement

 

  • Vie privée et sécurité

 

  • Efficience des coûts

 

  • Personnalisation

Capture d'écran 2025-02-19 à 11.47.54.png

Travailler avec Llama 3

Utiliser Llama localement

  • Disponible localement quand Python est installé

Capture d'écran 2025-02-19 à 11.54.07.png

  • Utilisable via la bibliothèque llama-cpp-python
  • Exécutez pip install
pip install llama-cpp-python
Travailler avec Llama 3

Poser des questions à Llama

from llama_cpp import Llama

llm = Llama(model_path = "path/to/model.gguf")
output = llm("What are some ways to improve customer retention?")
  • Importer la classe Llama
  • Initialiser le LLM
    • Envoyer des invites et obtenir des réponses
    • Modèle au format GGUF
  • Soumettre une question au LLM
Travailler avec Llama 3

Poser des questions à Llama

 

  • Le modèle reçoit l'invite
  • Traite l'invite
  • Retourne une réponse

invite.jpg

Travailler avec Llama 3

Décortiquer la sortie

  • La réponse est sous forme de dictionnaire
output
{'id': 'cmpl-af88304f-97b0-49f5-ba20-db87f86c4068',
 'object': 'text_completion',
 'created': 1715222298,
 'model': './Llama3-gguf-unsloth.Q4_K_M.gguf',
 'choices': [{'text': 'Improving customer retention is crucial for any business, as 
 it leads to increased revenue, positive word-of-mouth, and cost savings...'},
 ...]
}
Travailler avec Llama 3

Décortiquer la sortie

  • Accéder à "text" dans l'élément 0 de "choices"
output["choices"][0]["text"]
'Improving customer retention is crucial for any business, as 
 it leads to increased revenue, positive word-of-mouth, and cost savings. 
 Here are some effective ways to boost customer retention:
 1. Personalize the Customer Experience
 Tailor your interactions with customers based on their preferences, behaviors, and 
 purchase history. Use data and analytics to create personalized offers, 
 recommendations, and communications.
 2. Foster Strong Relationships
 Build strong, human connections with your customers. Train your...'
Travailler avec Llama 3

Passons à la pratique !

Travailler avec Llama 3

Preparing Video For Download...