mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-04-20 14:28:54 +00:00
Templates: Add stop_strings meta param
Adding the stop_strings var to chat templates will allow for the template creator to specify stopping strings to add onto chat completions. Thes get appended with existing stopping strings that are passed in the API request. However, a sampler override with force: true will override all stopping strings. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@@ -508,7 +508,10 @@ async def chat_completion_request(request: Request, data: ChatCompletionRequest)
|
||||
if isinstance(data.messages, str):
|
||||
prompt = data.messages
|
||||
else:
|
||||
prompt = format_prompt_with_template(data)
|
||||
# Compile the prompt and get any additional stop strings from the template
|
||||
# Template stop strings can be overriden by sampler overrides if force is true
|
||||
prompt, template_stop_strings = format_prompt_with_template(data)
|
||||
data.stop += template_stop_strings
|
||||
|
||||
disable_request_streaming = unwrap(
|
||||
config.developer_config().get("disable_request_streaming"), False
|
||||
|
||||
Reference in New Issue
Block a user