Skip to content

Commit

Permalink
feat: change CSV dataset file format structure
Browse files Browse the repository at this point in the history
Change the CSV dataset file format structure from one
column which is 'text' column to three columns structure
which are 'system', 'prompt' and 'response' columns.
  • Loading branch information
AbdulrhmanGoni committed Jan 17, 2025
1 parent cd99046 commit 2c725a1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/services/export/CSV_Format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ function CSV_Formater({
answer,
}: InstructionBase): string {
return (
`"${systemMessage ? sanitizer(systemMessage) + ". " : ""}` +
`### Prompt: ${sanitizer(question)}. ` +
`### Response: ${sanitizer(answer)}." \n`
`"${systemMessage ? sanitizer(systemMessage) : ""}",` +
`"${sanitizer(question)}","${sanitizer(answer)}"\n`
);
}

const QAFormat: DatasetFormat = {
formater: CSV_Formater,
decorators: {
first: "text\n",
first: "system,prompt,response\n",
},
};

Expand Down

0 comments on commit 2c725a1

Please sign in to comment.