更新於 2024/11/06閱讀時間約 4 分鐘

AI說書 - 從0開始 - 239 | 微調 GPT 模型之推論

我想要一天分享一點「LLM從底層堆疊的技術」,並且每篇文章長度控制在三分鐘以內,讓大家不會壓力太大,但是又能夠每天成長一點。


先列出目前擁有的材料:


以下開始使用程式來測試微調好的模型:

text_content = "Space and time are key factors in human reasoning. Human minds cannot think without space and time perceptions."
prompt = "Continue the following text as if you were a scientist and philosopher" + text_content

response = client.completions.create(model = "ft:babbage-002:personal::8g9QuR5t",
prompt = prompt,
max_tokens = 1000,
temperature = 0.8)

if response.choices:
first_choice = response.choices[0]
print("Model's Completion:", first_choice.text)
else:
print("No choices returned in the response")


摘錄的結果為:


分享至
成為作者繼續創作的動力吧!
© 2024 vocus All rights reserved.