恭喜你!

使用 Llama 3

Imtihan Ahmed

Machine Learning Engineer

複習一下

步驟 1-在本機執行 Llama

from llama_cpp import Llama

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

複習一下

步驟 2-調整參數

$$

  • temperaturetop_ktop_p 參數
使用 Llama 3

複習一下

步驟 3-設定角色

message_list = [{"role": "system", "content": system_message},
               {"role": "user", "content": user_message}]
使用 Llama 3

複習一下

步驟 4-引導輸出

  • 精準提示
  • stop 字詞
  • Zero-shot/Few-shot 提示
使用 Llama 3

複習一下

步驟 5-使用 JSON 回應 $$

response_format = {"type": "json_object"}
使用 Llama 3

複習一下

步驟 6-建立多輪對話

  • Conversation 類別
  • .create_completion() 方法
使用 Llama 3

下一步是什麼?

使用 Llama 3

謝謝!

使用 Llama 3

Preparing Video For Download...