Llama란?

Llama 3 다루기

Imtihan Ahmed

Machine Learning Engineer

강사 소개

 

  • Imtihan Ahmed
  • 머신러닝 엔지니어
  • 경력 6년
  • 대규모 AI

  강사 프로필 사진

Llama 3 다루기

Llama 3란?

 

  • 요약

2025-02-19 오전 11.01.25 스크린샷.png

Llama 3 다루기

Llama 3란?

 

  • 요약

 

  • 데이터 분석

2025-02-19 오전 11.01.16 스크린샷.png

Llama 3 다루기

Llama 3란?

 

  • 요약

 

  • 데이터 분석

 

  • 코딩 도우미

2025-02-19 오전 11.01.07 스크린샷.png

Llama 3 다루기

Llama 3란?

2025-02-19 오전 11.32.24 스크린샷.png

Llama 3:

  • Meta 개발
Llama 3 다루기

Llama 3란?

2025-02-19 오전 11.32.18 스크린샷.png

Llama 3:

  • Meta 개발
  • 텍스트 생성
Llama 3 다루기

Llama 3란?

2025-02-19 오전 11.32.12 스크린샷.png

  • Meta 개발
  • 텍스트 생성
  • 대규모 데이터로 학습
    • 위키백과 2000개 분량
  • 오픈 소스
Llama 3 다루기

Llama 3를 로컬로 실행하는 이유

  • 예: 산업 자동화
    • Llama로 유지보수 예측

3.jpg

1 https://ai.meta.com/blog/aitomatic-built-with-llama/
Llama 3 다루기

Llama 3를 로컬로 실행하는 이유

 

  • 프라이버시와 보안

2025-02-19 오전 11.48.10 스크린샷.png

Llama 3 다루기

Llama 3를 로컬로 실행하는 이유

 

  • 프라이버시와 보안

 

  • 비용 효율

2025-02-19 오전 11.48.03 스크린샷.png

Llama 3 다루기

Llama 3를 로컬로 실행하는 이유

 

  • 프라이버시와 보안

 

  • 비용 효율

 

  • 커스터마이징

2025-02-19 오전 11.47.54 스크린샷.png

Llama 3 다루기

로컬에서 Llama 사용하기

  • Python 설치 시 로컬 사용 가능

2025-02-19 오전 11.54.07 스크린샷.png

  • llama-cpp-python 라이브러리로 사용
  • pip 설치 실행
pip install llama-cpp-python
Llama 3 다루기

Llama에 질문하기

from llama_cpp import Llama

llm = Llama(model_path = "path/to/model.gguf")
output = llm("What are some ways to improve customer retention?")
  • Llama 클래스 임포트
  • LLM 초기화
    • 프롬프트 전송·응답 수신
    • 모델 형식: GGUF
  • 질문을 LLM에 전달
Llama 3 다루기

Llama에 질문하기

 

  • 모델이 프롬프트를 받음
  • 프롬프트 처리
  • 응답 반환

프롬프트 예시

Llama 3 다루기

출력 살펴보기

  • 응답은 딕셔너리 형식
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...'},
 ...]
}
Llama 3 다루기

출력 살펴보기

  • "choices"0번째 요소에서 "text" 접근
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...'
Llama 3 다루기

연습해 봅시다!

Llama 3 다루기

Preparing Video For Download...