Mark Ku's Blog

接續先前 LLama factory 的微調

首先,我打算用,並用本地的資料集 (Data Set)進行訓練

定義本地資料夾 faqs 訓練檔 acer_faqs.json

[
  {
    "instruction": "Explain how much a good gaming PC costs.",
    "input": "How much is a good gaming PC?",
    "output": "There are many ways to define a good gaming PC, as different gamers have different needs. At Acer, you can purchase a solid, entry-level gaming PC for as little as $849. If you are looking for a high-performance PC that can handle the highest resolutions at high speeds, a good gaming PC would be around $4,000. On average, good gaming PCs range between $1,000 and $4,000."
  },
  {
    "instruction": "List some good gaming PC options.",
    "input": "What are good gaming PCs?",
    "output": "Many manufacturers and builders offer good gaming PCs with quality components. Acer has a large inventory of great gaming PCs, including both Intel and AMD desktops. The latest 12th generation Intel desktops and Ryzen 9 desktops each provide some of the most seamless gaming experiences."
  },
  {
    "instruction": "Define what a gaming PC is.",
    "input": "What is a gaming PC?",
    "output": "Gaming PCs are specially designed personal computers made for playing video games with high quality. They are more powerful and have more advanced components than typical computers to provide better graphics and working memory to handle the load of running games."
  },
  {
    "instruction": "Where can someone buy a gaming PC?",
    "input": "Where to buy a gaming PC?",
    "output": "When considering buying a gaming PC, you have many options between in-store and online retailers. Acer offers great deals and discounts on gaming PCs that use top-tier components."
  }
]

接著,將要訓練的資料夾,放在LLaMA-Factory\data\

data set folder
data set folder

修改在 dataset_info.json,加上剛剛定義的檔案,此時在資料集的下拉選單就會出現 acer_faqs 資料集。

{
....
"acer_faqs": {
    "file_name": "acer_faqs.json"
  }  
...
}

當然,你也可以取得開源的資料集( dataSet ),訓練你的AI。

Huggingface's dataset

同時你也可以拿開源的Dataset 訓練你的AI 模型,透過修改dataset_info.json。

開始訓練

用 TUF RTX 3080 10g 開始訓練
用 TUF RTX 3080 10g 開始訓練

接著,將訓練好的AI 模型,進行測試

image 我大概試了幾個資料集,也用預設的wiki_faq 資料集訓練, 看著自己訓練半天的AI 會亂回答,覺得蠻好笑的。

從 Google 上查了一下,也蠻多人發生亂回答的現象,估計一般PC 的顯卡的內存,只能訓練這種閹割版的開源模型,可能要用完整版的模型,用AI晶片訓練,才可能會更精準。

hardware requirement
hardware requirement

最後

看著自己訓練半天的AI,只會亂回答,看起來如果要達成 AI Bot需求,目前用別人訓練好的模型及AI Agent 技術 會是比較容易達到的。

如果自己訓練AI的資料量要夠大,針對大型開源模型要微調,對顯示晶片要求很高,也有很多複雜的參數要學,我想訓練AI的技術,並還沒有很容易操作及下放到一般公司可以輕易使用,真不知道檯面上的大型AI 模型是花多少錢和心力推砌出來的。

因為我是AI訓練的的小白,如果我有什麼誤解,歡迎交流或可以私訊告訴我。

作者

Mark Ku

擁有 10+ 年經驗的資深軟體工程師,現為 AI 應用 Builder,專注於大型平台架構與簡化複雜系統設計,從電商系統到訂閱與收費平台,結合 AI Agent、AI 整合與自動化開發,打造高效率且可持續演進的產品技術基礎。閱讀更多

覺得這篇有幫助?

作者做的免費工具、每日 Podcast 與電子報,都在這裡。

Mark Ku · 本文採用 CC BY 4.0 授權,轉載請註明作者並附上原文連結。

留言

訂閱電子報

訂閱後即時收到新文章通知,不錯過任何技術分享。

提交即表示同意接收電子報,隨時可

熱門文章

View all
Mark Ku
··604

Oracle Cloud 永久免費方案 Linux 主機及固定 IP :0 元打造雲端解決方案

Oracle Cloud 永久免費方案 Linux 主機及固定 IP :0 元打造雲端解決方案
Mark Ku
··471

告別 Postman 收費陷阱!開源 Git 原生 API 測試神器 Bruno 實戰指南

告別 Postman 收費陷阱!開源 Git 原生 API 測試神器 Bruno 實戰指南
Mark Ku
··329

一款免費開源類似於 Notion 類知識庫系統 — Outline Wiki 佈署與備份全攻略

一款免費開源類似於 Notion 類知識庫系統 — Outline Wiki 佈署與備份全攻略
Mark Ku
··240

打造高效 API 管理平台:從 0 開始部署 Kong Gateway - Part 1

打造高效 API 管理平台:從 0 開始部署 Kong Gateway - Part 1
Mark Ku
··235

訓練自己的 AI 語音:硬體門檻、開源模型比較與 LoRA 微調

訓練自己的 AI 語音:硬體門檻、開源模型比較與 LoRA 微調
Mark Ku
··216

在 Ubuntu 上設置 Samba 來共享資料夾,讓 Windows 11 用戶可以存取

在 Ubuntu 上設置 Samba 來共享資料夾,讓 Windows 11 用戶可以存取

讀者也在看

開源AI微調工具 - LLAMA Factory 環境建置

Mark Ku

·5 min read·28

AI 時代的舊系統重構翻新策略

Mark Ku

·7 min read·81

2024 Computex 心得  - AI PC 元年

Mark Ku

·3 min read·29

Vibe Coding 經驗分享

Mark Ku

·10 min read·17