0cc4m / KoboldAI

GNU Affero General Public License v3.0
150 stars 31 forks source link

Strip the eos token from exllama generations. #62

Closed pi6am closed 1 year ago

pi6am commented 1 year ago

The end-of-sequence (</s>) token indicates the end of a generation. When a token sequence containing </s> is decoded, an extra (incorrect) space is inserted at the beginning of the text. To avoid this, strip the eos token out of the result before returning it. The eos token was getting stripped later, so this doesn't change the output except to avoid the spurious leading space.