Model: Store directory paths

Storing a pathlib type makes it easier to manipulate the model
directory path in the long run without constantly fetching it
from the config.

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri
2024-08-29 22:49:20 -04:00
committed by Brian Dashore
parent 523709741c
commit dd55b99af5
4 changed files with 17 additions and 21 deletions

View File

@@ -52,7 +52,7 @@ async def completion_request(
If stream = true, this returns an SSE stream.
"""
model_path = model.container.get_model_path()
model_path = model.container.model_dir
if isinstance(data.prompt, list):
data.prompt = "\n".join(data.prompt)
@@ -105,7 +105,7 @@ async def chat_completion_request(
raise HTTPException(422, error_message)
model_path = model.container.get_model_path()
model_path = model.container.model_dir
if isinstance(data.messages, str):
prompt = data.messages