chatgpt-demo icon indicating copy to clipboard operation
chatgpt-demo copied to clipboard

Code rendering error

Open cola-sys opened this issue 2 years ago • 8 comments

Describe the bug

When I use the same sentence to ask, chatgpt-demo cannot render it correctly.

Wrong: image

Correct: image

Reproduction

reproduction

System Info

Web

Used Package Manager

npm

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the Contributing Guide.
  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • [X] The provided reproduction is a minimal reproducible of the bug.

cola-sys avatar Mar 09 '23 09:03 cola-sys

他的回答一直是随机性呀。

h7ml avatar Mar 09 '23 10:03 h7ml

他的回答一直是随机性呀。

不是回答的问题,是没有渲染出代码框

cola-sys avatar Mar 09 '23 10:03 cola-sys

他的回答一直是随机性呀。

不是回答的问题,是没有渲染出代码框

这种是gpt返回的不是标准markdown格式造成的,它直接返回文本

yzh990918 avatar Mar 09 '23 10:03 yzh990918

他的回答一直是随机性呀。

不是回答的问题,是没有渲染出代码框

这种是gpt返回的不是标准markdown格式造成的,它直接返回文本

有个疑问,为什么下面回答的网站也是调用api就能正常渲染。地址在这:https://freegpt.one/

cola-sys avatar Mar 09 '23 11:03 cola-sys

有个疑问,为什么下面回答的网站也是调用api就能正常渲染。地址在这:https://freegpt.one/

我也比较疑惑这个,似乎我们更容易输出非 markdown 答案。

ddiu8081 avatar Mar 09 '23 11:03 ddiu8081

他的回答一直是随机性呀。

不是回答的问题,是没有渲染出代码框

这种是gpt返回的不是标准markdown格式造成的,它直接返回文本

有个疑问,为什么下面回答的网站也是调用api就能正常渲染。地址在这:https://freegpt.one/

代码渲染是基于 markdown-it 做的,假如接口直接返回不符合规范的代码文本是无法高亮的,你给的截图回答中附带了中文提示和代码,接口返回的是标准markdown格式,所以这似乎并不是一个问题。

yzh990918 avatar Mar 09 '23 11:03 yzh990918

有个疑问,为什么下面回答的网站也是调用api就能正常渲染。地址在这:https://freegpt.one/

我也比较疑惑这个,似乎我们更容易输出非 markdown 答案。

似乎模型是需要训练的,每个人情况不一样,我遇到这种情况较少。 image

yzh990918 avatar Mar 09 '23 11:03 yzh990918

有个疑问,为什么下面回答的网站也是调用api就能正常渲染。地址在这:https://freegpt.one/

我也比较疑惑这个,似乎我们更容易输出非 markdown 答案。

对的,我尝试多次重新生成回答,每次回答都是只给普通的文本代码,而下面的不仅会回答markdown格式的代码,还会对整个代码做详细的解释,似乎更“智能”一些?

cola-sys avatar Mar 09 '23 11:03 cola-sys