Llama คืออะไร?

การทำงานกับ Llama 3

Imtihan Ahmed

Machine Learning Engineer

แนะนำผู้สอน

 

  • Imtihan Ahmed
  • Machine Learning Engineer
  • ประสบการณ์ 6 ปี
  • AI ในระดับองค์กร

  รูปโปรไฟล์ผู้สอน

การทำงานกับ Llama 3

Llama 3 คืออะไร?

 

  • การสรุปความ

Screenshot 2025-02-19 at 11.01.25.png

การทำงานกับ Llama 3

Llama 3 คืออะไร?

 

  • การสรุปความ

 

  • การวิเคราะห์ข้อมูล

Screenshot 2025-02-19 at 11.01.16.png

การทำงานกับ Llama 3

Llama 3 คืออะไร?

 

  • การสรุปความ

 

  • การวิเคราะห์ข้อมูล

 

  • ผู้ช่วยเขียนโค้ด

Screenshot 2025-02-19 at 11.01.07.png

การทำงานกับ Llama 3

Llama 3 คืออะไร?

Screenshot 2025-02-19 at 11.32.24.png

Llama 3:

  • พัฒนาโดย Meta
การทำงานกับ Llama 3

Llama 3 คืออะไร?

Screenshot 2025-02-19 at 11.32.18.png

Llama 3:

  • พัฒนาโดย Meta
  • การสร้างข้อความ
การทำงานกับ Llama 3

Llama 3 คืออะไร?

Screenshot 2025-02-19 at 11.32.12.png

  • พัฒนาโดย Meta
  • การสร้างข้อความ
  • ฝึกด้วยชุดข้อมูลขนาดใหญ่
    • เทียบเท่า Wikipedia 2,000 ฉบับ
  • โอเพนซอร์ส
การทำงานกับ Llama 3

ทำไมต้องรัน Llama 3 ในเครื่องตัวเอง

  • ตัวอย่าง: ระบบอัตโนมัติในอุตสาหกรรม
    • Llama ทำนายความต้องการบำรุงรักษา

3.jpg

1 https://ai.meta.com/blog/aitomatic-built-with-llama/
การทำงานกับ Llama 3

ทำไมต้องรัน Llama 3 ในเครื่องตัวเอง

 

  • ความเป็นส่วนตัวและความปลอดภัย

Screenshot 2025-02-19 at 11.48.10.png

การทำงานกับ Llama 3

ทำไมต้องรัน Llama 3 ในเครื่องตัวเอง

 

  • ความเป็นส่วนตัวและความปลอดภัย

 

  • ประหยัดค่าใช้จ่าย

Screenshot 2025-02-19 at 11.48.03.png

การทำงานกับ Llama 3

ทำไมต้องรัน Llama 3 ในเครื่องตัวเอง

 

  • ความเป็นส่วนตัวและความปลอดภัย

 

  • ประหยัดค่าใช้จ่าย

 

  • การปรับแต่ง

Screenshot 2025-02-19 at 11.47.54.png

การทำงานกับ Llama 3

ใช้งาน Llama ในเครื่องตัวเอง

  • ใช้งานได้ในเครื่องเมื่อติดตั้ง Python แล้ว

Screenshot 2025-02-19 at 11.54.07.png

  • ใช้งานผ่านไลบรารี llama-cpp-python
  • รัน pip install
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
    • ส่ง prompt และรับผลลัพธ์ได้
    • โมเดลอยู่ในรูปแบบ GGUF
  • ส่งคำถามไปยัง LLM
การทำงานกับ Llama 3

การถามคำถามกับ Llama

 

  • โมเดลรับ prompt
  • ประมวลผล prompt
  • ส่งคืนผลลัพธ์

prompting.jpg

การทำงานกับ Llama 3

แยกส่วนผลลัพธ์

  • ผลลัพธ์อยู่ในรูปแบบ dictionary
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

แยกส่วนผลลัพธ์

  • เข้าถึง "text" จากองค์ประกอบที่ 0 ใน "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...'
การทำงานกับ Llama 3

มาฝึกกันเถอะ!

การทำงานกับ Llama 3

Preparing Video For Download...