mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-04-20 14:28:54 +00:00
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:
@@ -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
|
||||
|
||||
@@ -43,11 +43,12 @@ async def get_current_model_list(model_type: str = "model"):
|
||||
model_path = None
|
||||
|
||||
# Make sure the model container exists
|
||||
if model_type == "model" or model_type == "draft":
|
||||
if model.container:
|
||||
model_path = model.container.get_model_path(model_type == "draft")
|
||||
elif model_type == "embedding":
|
||||
if model.embeddings_container:
|
||||
match model_type:
|
||||
case "model":
|
||||
model_path = model.container.model_dir
|
||||
case "draft":
|
||||
model_path = model.container.draft_model_dir
|
||||
case "embedding":
|
||||
model_path = model.embeddings_container.model_dir
|
||||
|
||||
if model_path:
|
||||
|
||||
Reference in New Issue
Block a user