Llama 3 पैरामीटर ट्यून करना

Llama 3 के साथ काम करना

Imtihan Ahmed

Machine Learning Engineer

पैरामीटर किस काम आते हैं?

from llama_cpp import Llama
llm = Llama(model_path="path/to/model.gguf")
output = llm("What are some ways to improve customer retention?")

गुणवत्ता, रैंडमनेस, और लंबाई को नियंत्रित करें

Llama 3 के साथ काम करना

पैरामीटर किस काम आते हैं?

  • उदाहरण: प्रोडक्ट डिस्क्रिप्शन जनरेट करना

professional_site.png

→ तथ्यपरक और संक्षिप्त होना चाहिए

 

लाइफस्टाइल-उन्मुख साइट

 

→ आकर्षक और क्रिएटिव होना चाहिए

Llama 3 के साथ काम करना

Llama 3 decoding parameters

$$

  • Llama का व्यवहार एडजस्ट करें

$$

  • अलग टोन मिलाने के लिए decoding parameters इस्तेमाल करें

$$

  • कच्चे आउटपुट को पढ़ने योग्य टेक्स्ट में बदलें

पैरामीटर से Llama का व्यवहार एडजस्ट करना

Llama 3 के साथ काम करना

Llama 3 decoding parameters

$$

  • Temperature: रैंडमनेस नियंत्रित करता है
  • Top-K: सबसे सम्भावित विकल्पों तक टोकन चयन सीमित करता है
  • Top-P: संचयी प्रायिकता के आधार पर टोकन चयन एडजस्ट करता है
  • Max tokens: प्रतिक्रिया की लंबाई सीमित करता है

$$

Screenshot 2025-02-26 at 12.51.27.png

Llama 3 के साथ काम करना

Temperature

  • मान आमतौर पर 0 और 1 के बीच होते हैं

  • Low temperature (जैसे 0 के पास):

    • अधिक पूर्वानुमेय प्रतिक्रिया
      A smartwatch with a heart rate monitor, GPS, and a long-lasting battery 
      for all-day tracking.
      
  • High temperature (जैसे 1 के पास):
    • अधिक क्रिएटिव प्रतिक्रिया
      Your personal fitness coach on your wrist - track every heartbeat, every step, 
      and every adventure without limits.
      
Llama 3 के साथ काम करना

Top-k

  • Llama कितने सबसे सम्भावित शब्दों में से चुन सकता है, इसे सीमित करता है

  • Low k value (जैसे, 1):

    • अधिक पूर्वानुमेय प्रतिक्रिया
      Track fitness, stream music, and receive notifications with our sleek smartwatch.
      
  • High k value (जैसे, 50):

    • अधिक विविध प्रतिक्रिया
      Experience the future with our cutting-edge smartwatch, featuring fitness tracking, music streaming, customizable notifications, personalized insights, and seamless smartphone integration always.
      
Llama 3 के साथ काम करना

Top-p

  • कॉन्फिडेंस के आधार पर आउटपुट शब्दों के चयन को नियंत्रित करता है

  • High top-p value (जैसे, 1 के पास):

    • अधिक विविध प्रतिक्रियाएँ
      Stay connected with our sleek smartwatch, featuring fitness tracking,
      music, and customizable notifications, perfect for fitness 
      enthusiasts and busy professionals.
      
  • Low top-p value (जैसे, 0 के पास):

    • कम विविधता
      Smartwatch with fitness tracking and music control, perfect for workouts.
      
Llama 3 के साथ काम करना

Max tokens

  • प्रतिक्रिया की लंबाई सीमित करने के लिए इस्तेमाल होता है
  • टोकन की गिनती—शब्दों की इकाइयाँ—जो प्रतिक्रिया में होती हैं

  • Low max_tokens मान:

    Stay connected with our sleek smartwatch, featuring fitness tracking 
    and music control.
    
  • High max_tokens मान:
    Stay connected with our sleek smartwatch, featuring fitness tracking, 
    music control, customizable notifications, and seamless smartphone 
    integration. Monitor your health, track your progress, and receive 
    alerts on your wrist. Perfect for fitness enthusiasts.
    
Llama 3 के साथ काम करना

अलग-अलग पैरामीटर मिलाना

llm = Llama(model_path="path/to/model.gguf")

output_concise = llm(
    "Describe an electric car.",

temperature=0.2,
top_k=1,
top_p=0.4,
max_tokens=20
)
A fast, eco-friendly electric car with a long range and cutting-edge technology.
Llama 3 के साथ काम करना

अलग-अलग पैरामीटर मिलाना

output_creative = llm(
    "Describe an electric car.",

temperature=0.8,
top_k=10,
top_p=0.9,
max_tokens=100
)
Glide into the future with an electric car that blends speed, luxury,
and sustainability. Silent yet powerful, it redefines the road ...
Llama 3 के साथ काम करना

अभ्यास करते हैं!

Llama 3 के साथ काम करना

Preparing Video For Download...