資料集管理
有效的資料集準備對於機器學習模型的成功微調至關重要。高品質且結構良好的資料集確保模型能夠準確學習並有效泛化。 為了支援這一點,我們的系統提供了兩種靈活的資料集管理方法,既迎合了偏好手動準備的進階用戶,也滿足了尋求自動化解決方案的用戶。
資料集管理功能提供兩種處理資料集的方法:
方法 1:上傳預處理的資料集 JSON / JSONL 檔案
用戶可以按指定格式準備自己的資料集檔案並上傳。範例格式如下:
- QA 格式
- Harmony 格式
- ChatML 格式
- 整個 QA 格式的文件是一個 JSON 陣列,以
[啟始,]結束(行號 1,10)。 - 每個 JSON 陣列裡的元素必須是個 JSON 物件,分別以
{啟始,}結束,(行號 2,5 與 6,9)。 - 每個 JSON 物件必須包含兩個鍵值對,分別是
instruct與output,(行號 3,4 與 7,8)。instrcut對應的是問題內容,output則是對應該問題的回答。
[
{
"instruct": "What processor is integrated into the AIR-100 system?",
"output": "The AIR-100 system is integrated with an Intel Atom Processor E3950."
},
{
"instruct": "What graphics engine is used for HDMI-1 and HDMI-2 outputs in the AIR-100?",
"output": "The graphics engine used for HDMI-1 and HDMI-2 outputs in the AIR-100 is the NVIDIA GeForce GT 1030."
}
]
- 整個 Harmony 格式的文件是一個 JSON 陣列,以
[啟始,]結束(行號 1,36)。 - 每個 JSON 陣列裡的元素必須是個 JSON 物件,分別以
{啟始,}結束,(行號 2,13 與 14,35)。且只能有唯一一個鍵值對messages(行號 3,15)。 - 每個
messages必須是個 JSON 陣列,其內每個元素則必須為 JSON 物件,物件內必須包含兩個鍵值對role(行號 5,9,17,21,25,30)、content(行號 6,10,18,22,27,32)與一個可有可無的channel(行號 26,31)。role: 只能是system(行號 17)、user(行號 5,21)或assistant(行號 9,25,30)。system只能出現在messages陣列中的第一個元素(行號 17)。content: 對應的訊息內容。若role的值是system代表提示詞(行號 18)、若值為user代表問題的內容(行號 6,22)、若值為assistant則是代表對應問題的答案(行號 10)。channel: 只能在role為assistant時使用,且對應的值只能是analysis(行號 26),commentary或final(行號 31)。此時content的值分別代表模型的思路(行號 27)、 註解或評論、 以及最終的答案(行號 32)。
[
{
"messages": [
{
"role": "user",
"content": "What processor is integrated into the AIR-100 system?"
},
{
"role": "assistant",
"content": "The AIR-100 system is integrated with an Intel Atom Processor E3950."
}
]
},
{
"messages": [
{
"role": "system",
"content": "You are an assistant with advanced reasoning capabilities."
},
{
"role": "user",
"content": "Prove why the square root of 2 is irrational."
},
{
"role": "assistant",
"channel": "analysis",
"content": "I need to prove that sqrt(2) is irrational. I will use proof by contradiction.\nAssume sqrt(2) is rational, meaning it can be written as p/q where p and q are coprime integers, and q != 0.\nThen 2 = p^2 / q^2 => p^2 = 2q^2. This implies p^2 is even, so p must be even.\nLet p = 2k. Then (2k)^2 = 2q^2 => 4k^2 = 2q^2 => q^2 = 2k^2. This implies q^2 is even, so q must be even.\nIf both p and q are even, they share a common factor of 2, which contradicts the assumption that they are coprime.\nTherefore, the assumption is false, and sqrt(2) is irrational."
},
{
"role": "assistant",
"channel": "final",
"content": "We can prove that $\\sqrt{2}$ is irrational using a proof by contradiction:\n\n1. **Assumption**: Suppose $\\sqrt{2}$ is a rational number. This means it can be written as a fraction $\\frac{p}{q}$, where $p$ and $q$ are coprime integers (they share no common factors other than 1) and $q \\neq 0$.\n2. **Squaring both sides**: $2 = \\frac{p^2}{q^2} \\implies p^2 = 2q^2$. This shows that $p^2$ is an even number, which means $p$ itself must also be an even number.\n3. **Substitution**: Since $p$ is even, we can write $p = 2k$ for some integer $k$. Substituting this back gives: $(2k)^2 = 2q^2 \\implies 4k^2 = 2q^2 \\implies q^2 = 2k^2$. This means $q^2$ is also an even number, so $q$ must be even as well.\n4. **Contradiction**: If both $p$ and $q$ are even, they both have 2 as a common factor. This directly contradicts our initial assumption that $p$ and $q$ are coprime.\n\nSince the assumption leads to a contradiction, it must be false. Therefore, $\\sqrt{2}$ is irrational."
}
]
}
]
- 整個 ChatML 的文件是一個 JSONL 的格式,每一行必須為一個 JSON 物件。
- 每個 JSON 物件只能包含一個鍵值對
messages。 - 每個
messages必須是個 JSON 陣列,其內每個元素則必須為 JSON 物件,物件內必須包含兩個鍵值對role與content。role: 只能是system、user或assistant。system只能出現在messages陣列中的第一個元素。content: 對應的訊息內容。若role的值是system代表提示詞、若值為user代表問題的內容、若值為assistant則是代表對應問題的答案。
{"messages": [{"role": "user", "content": "What processor is integrated into the AIR-100 system?"}, {"role": "assistant", "content": "The AIR-100 system is integrated with an Intel Atom Processor E3950."}]}
{"messages": [{"role": "user", "content": "What graphics engine is used for HDMI-1 and HDMI-2 outputs in the AIR-100?"}, {"role": "assistant", "content": "The graphics engine used for HDMI-1 and HDMI-2 outputs in the AIR-100 is the NVIDIA GeForce GT 1030."}]}
{"messages": [{"role": "user", "content": "How many HDMI outputs does the AIR-100 support, and what are their versions?"}, {"role": "assistant", "content": "The AIR-100 supports 4 HDMI outputs, with 2 HDMI 1.4 outputs and 2 HDMI 2.0 outputs."}]}```

注意
- 上傳的 JSON/JSONL 檔案必須遵循對應的格式,且檔案大小不應超過 10 MB。
- 上傳後,檔案將在對應格式的資料集清單中列出,顯示檔案名稱和大小。
- 用戶可以刪除任何已上傳的檔案。
方法 2:透過資料集生成器自動生成資料集
請注意
目前 GenAI Studio 的資料集生成器只能使用在 QA 格式的資料,Harmony 格式的資料集生成器會在後續版本中新增。
用戶可以上傳 PDF(.pdf)、Word (.docx)、純文字 (.txt) 或 Excel (.xlsx) 文件, 系統將從這些檔案自動生成指定數量的資料集。

- 上傳的檔案大小不得超過 10 MB。
- 用戶需要指定要生成的資料集數量,並點擊
開始來啟動程序。 - 如果檔案中的資料不足,可能會出現 資料集數量太小 的訊息。
- 上傳的文件將顯示在文件清單中,每個條目都可以編輯或刪除。
- 系統將顯示生成進度和狀態,如 用戶停止 或 已完成。
- 用戶可以點擊
文件清單中的個別條目來查看生成資料集的詳細內容並即時編輯。
- 點擊
生成資料集檔案允許用戶選擇多個文件並將它們合併為單個 JSON 檔案,可用於後續的微調。
這兩種方法為用戶提供了靈活性,無論他們偏好上傳完全準備好的 JSON 檔案或使用系統工具進行快速資料集生成,都能滿足不同的需求。