開始使用免費開始

引導客服回應

你在一家電商公司工作,正把 Llama 整合到客服助理中。這個助理會回答常見問題,不過你發現回應太過重複。

你需要調整解碼參數,讓用詞更加多變,同時維持回應的資訊量。

模型已透過 llama_cpp 建立並存於 llm

本練習屬於課程

使用 Llama 3

檢視課程

練習說明

  • 設定 temperature 參數,讓回應更不重複、更有變化。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

output = llm(
		"Can I exchange an item I purchased?", 
  		# Set the temperature parameter to provide more varied responses
		temperature=____,
        max_tokens=15
) 

print(output['choices'][0]['text'])
編輯並執行程式碼