mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-03-15 00:07:28 +00:00
API: Fix template switch endpoint
Forwards a Path instead of a string and adheres to the new pathfinding system. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@@ -445,7 +445,8 @@ async def switch_template(data: TemplateSwitchRequest):
|
||||
raise HTTPException(400, error_message)
|
||||
|
||||
try:
|
||||
model.container.prompt_template = PromptTemplate.from_file(data.name)
|
||||
template_path = pathlib.Path("templates") / data.name
|
||||
model.container.prompt_template = PromptTemplate.from_file(template_path)
|
||||
except FileNotFoundError as e:
|
||||
error_message = handle_request_error(
|
||||
f"The template name {data.name} doesn't exist. Check the spelling?",
|
||||
|
||||
Reference in New Issue
Block a user