Вступ до великих мовних моделей (LLMs)

Вступ до LLM у Python

Jasmin Ludolf

Senior Data Science Content Developer, DataCamp

Попередні знання

  • Орієнтування в Hugging Face Hub
  • Моделі глибокого навчання

Малюнок мозку, що читає книжку

Вступ до LLM у Python

Вступ до LLMs

 

Піктограма лампочки й мозку, що означає розуміння

Вступ до LLM у Python

Вступ до LLMs

 

Ілюстрація ноутбука, що означає використання

Вступ до LLM у Python

Абстрактна ілюстрація великої мовної моделі

Вступ до LLM у Python

Абстрактна ілюстрація великої мовної моделі з «summarize» бульбашкою

Вступ до LLM у Python

Абстрактна ілюстрація великої мовної моделі з «summarize» та «generate» бульбашками

Вступ до LLM у Python

Абстрактна ілюстрація великої мовної моделі з «summarize», «generate» і «translate» бульбашками

Вступ до LLM у Python

Абстрактна ілюстрація великої мовної моделі з «summarize», «generate», «translate», «Q&A» бульбашками

Логотипи LLM

Вступ до LLM у Python

LLMs

 

  • На базі архітектур глибокого навчання

 

  • Найчастіше — transformers

 

  • Величезні нейромережі з безліччю параметрів і текстових даних

Логотип Hugging Face

Вступ до LLM у Python

Використання моделей 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: видаляє зайві пробіли
Вступ до LLM у Python

Результати моделі

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
Вступ до LLM у Python

Далі

 

  • Розширюйте наявні знання про LLM
  • Виконуйте нові завдання
  • Дізнайтесь, як створюють LLM
  • Донавчайте LLM
  • Оцінюйте продуктивність LLM

Навчальний шлях

Вступ до LLM у Python

Давайте потренуємось!

Вступ до LLM у Python

Preparing Video For Download...