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:
parent
810cd40016
commit
54bfb770af
1 changed files with 2 additions and 1 deletions
|
|
@ -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?",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue