training: fix data EOL format

This commit is contained in:
josc146 2023-07-11 12:19:39 +08:00
parent 994fc7c828
commit e2fc57ac24

View File

@ -64,7 +64,7 @@ func (a *App) ConvertData(python string, input string, outputPrefix string, voca
if err != nil { if err != nil {
return "", err return "", err
} }
textJson, err := json.Marshal(map[string]string{"text": string(textContent)}) textJson, err := json.Marshal(map[string]string{"text": strings.ReplaceAll(strings.ReplaceAll(string(textContent), "\r\n", "\n"), "\r", "\n")})
if err != nil { if err != nil {
return "", err return "", err
} }