ms-swift icon indicating copy to clipboard operation
ms-swift copied to clipboard

The error occurred after adding the `loss` field according to the manual.(按照手册添加loss字段后报错)

Open shu-pi opened this issue 1 year ago • 1 comments

Data: { "messages": [ {"role": "user", "content": "xxx"}, {"role": "assistant", "content": "\n\n\n\nxxx", "loss": false} ], "channel": xxx }

Error: TypeError: Couldn't cast array of type [rank0]: struct<role: string, content: string, loss: bool> [rank0]: to [rank0]: {'role': Value(dtype='string', id=None), 'content': Value(dtype='string', id=None)}

swift version: 3.9.2

shu-pi avatar Oct 27 '25 06:10 shu-pi

Data: { "messages": [ {"role": "user", "content": "xxx"}, {"role": "assistant", "content": "\n\n\n\nxxx", "loss": false} ], "channel": xxx }

Error: TypeError: Couldn't cast array of type [rank0]: struct<role: string, content: string, loss: bool> [rank0]: to [rank0]: {'role': Value(dtype='string', id=None), 'content': Value(dtype='string', id=None)}

swift version: 3.9.2

先去掉channel字段试试

slin000111 avatar Dec 25 '25 03:12 slin000111