llm
llm copied to clipboard
Strip off last \r\n in the prompt file.
Naturally also works if it's just \r or just \n. (However \n\r would result in \n. If you put weird stuff like that in your prompt file, you deserve what you get.)
Closes #60
Seems reasonable, but is there a reason not to use str::trim_end or str::trim_end_matches?
@philpax Because those would strip off all the trailing newline/carriage return characters, making it 1) impossible to actually use a prompt from a file that ends with a newline and 2) different behavior from llama.cpp which is probably what people will expect it to function like.
I care more about the first one there personally since I think that may be something people will actually want/need to do.
Fair enough!
By the way, I hope that comment wasn't too blunt. With the numbered items it does kind of read like I was lecturing you or something. So it may have come off stronger than I intended (I'm just generally a pretty direct person though).
Oh no, don't worry - you explained it just fine. 'sall good :)