| 257 | if (apiType === TEXTGEN_TYPES.LLAMACPP && props['chat_template'].endsWith('\u0000')) { | 257 | if (apiType === TEXTGEN_TYPES.LLAMACPP && props['chat_template'].endsWith('\u0000')) { |
| 258 | props['chat_template'] = props['chat_template'].slice(0, -1); | 258 | props['chat_template'] = props['chat_template'].slice(0, -1); |
| 259 | } | 259 | } |
| | 260 | props['chat_template'] = props['chat_template'].trim(); |
| 260 | props['chat_template_hash'] = createHash('sha256').update(props['chat_template']).digest('hex'); | 261 | props['chat_template_hash'] = createHash('sha256').update(props['chat_template']).digest('hex'); |
| 261 | console.log(`We have chat template stuff: ${JSON.stringify(props)}`); | 262 | console.log(`We have chat template stuff: ${JSON.stringify(props)}`); |
| 262 | return response.send(props); | 263 | return response.send(props); |