"Literal mode" for outputs with HTML special characters
na-na-hi opened this issue · 10 comments
Currently it behaves like this. I can't find a setting that disables this behavior.
- HTML special characters aren't escaped in the outputs so they're interpretated as html tags in the browser, like
<b> and &These result in text formatting changes and broken embedded images in the output. - Once I edit the output with the "Allow Editing" enabled, these tags are stripped before being sent which results in context recalculation.
For some usecases this isn't desirable, such as code generation, where outputs are broken like #include <stdio.h> becoming #include .
I think it's useful to include a "Literal mode" setting that escapes these special characters on the browser side.
Thank you for alerting me. This is indeed a bug - bot response should definitely be sanitized before displaying! I will be fixing it shortly.
This should be fixed in the newest version.
Tested with koboldcpp 1.9.
The special characters are still not escaped while streaming is on and the text is in yellow color. Only after the response is complete and the text turns white, the output is escaped properly.
Also the new "Filter Comment Tags" option doesn't work. With GPT-2 models <|endoftext|> still appears on the output and is still sent verbatim for generation.
Okay I just realized escaping HTML severely breaks image rendering. I will be reverting it for the time being while I think of a better solution.
Hi @na-na-hi :
The HTML escaping should be working again, including the yellow streaming text.
As for the "Filter Comment Tags", it should also be working - note that it does not prevent the tags from appearing inside your story or editor, rather, it filters them out from the submitted prompt before they are sent for text generation.
Hi, please try v1.10 and see if this is still an issue.
So @na-na-hi I'm not sure if you are still seeing this bug, but there's a new way that may be useful to you. As stopping tokens was added, you can add <|endoftext|> as a custom stopping sequence now (in the memory panel) and it should work the same as how you want the EOS to work.
I tried to add <|endoftext|> as the stopping token and the generation didn't stop, instead it output the <|endoftext|> token repeatedly.
Also the issue of text not escaped while being streamed remains with the latest version.
