GaiZhenbiao / ChuanhuChatGPT

GUI for ChatGPT API and many LLMs. Supports agents, file-based QA, GPT finetuning and query with web search. All with a neat UI.
https://huggingface.co/spaces/JohnSmith9982/ChuanhuChatGPT
GNU General Public License v3.0
15.18k stars 2.29k forks source link

fix: address corner cases in filename sanitization #1070

Closed Yefori-Go closed 6 months ago

Yefori-Go commented 7 months ago

作者自述

描述

部分模型在总结对话草拟标题时可能无法很好的遵循指令,生成的标题会导致历史文件无法正常保存。 本次 pull request 主要对文件名中特殊字符的处理进行了优化,确保文件名在保存时不会因为特殊字符而导致系统错误。

Before: image

After: image

相关问题

913

补充信息

关于对话标题保存相关建议见评论区。

Yefori-Go commented 7 months ago

直接将总结的对话标题作为文件名保存存在不妥,我看了一下保存的对话json文件,其中包含一些对话元信息,是否可以考虑将标题存于元信息中,使用标题hash或保存时间戳等作为文件名?

GaiZhenbiao commented 7 months ago

确实,用hash作为文件名会更好。