Skip to content

Commit

Permalink
fix: stringify object while exporting batch result to csv (#3481)
Browse files Browse the repository at this point in the history
  • Loading branch information
sinomoe authored Apr 15, 2024
1 parent 58cbda2 commit 22994a6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion web/app/components/share/text-generation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,12 @@ const TextGeneration: FC<IMainProps> = ({
promptConfig?.prompt_variables.forEach((v) => {
res[v.name] = inputs[v.key]
})
res[t('share.generation.completionResult')] = batchCompletionResLatest[task.id]
let result = batchCompletionResLatest[task.id]
// task might return multiple fields, should marshal object to string
if (typeof batchCompletionResLatest[task.id] === 'object')
result = JSON.stringify(result)

res[t('share.generation.completionResult')] = result
return res
})
const checkBatchInputs = (data: string[][]) => {
Expand Down

0 comments on commit 22994a6

Please sign in to comment.