Trim whitespace in JSONL export content
Ensures whitespace-only message content is treated as empty and skipped in JSONL exports, preventing invalid SFT training samples.
This commit is contained in:
parent
b09e3052e0
commit
b0b6c4daf9
1 changed files with 1 additions and 1 deletions
|
|
@ -76,7 +76,7 @@ export async function exportAsJSONL(threadId: string): Promise<void> {
|
|||
|
||||
// OpenAI chat format -- standard SFT structure, skip empty turns
|
||||
const chatMessages = messages.flatMap((m) => {
|
||||
const content = extractText(m.content);
|
||||
const content = extractText(m.content).trim();
|
||||
if (!content) return [];
|
||||
return [{ role: m.role === "user" ? "user" : "assistant", content }];
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue