Model: Add params to current model endpoint

Grabs the current model rope params, max seq len, and the draft model
if applicable.

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri
2023-12-10 00:40:56 -05:00
parent 0f4290f05c
commit fd9f3eac87
3 changed files with 31 additions and 6 deletions

View File

@@ -2,11 +2,18 @@ from pydantic import BaseModel, Field
from time import time
from typing import List, Optional
class ModelCardParameters(BaseModel):
max_seq_len: Optional[int] = 4096
rope_scale: Optional[float] = 1.0
rope_alpha: Optional[float] = 1.0
draft: Optional['ModelCard'] = None
class ModelCard(BaseModel):
id: str = "test"
object: str = "model"
created: int = Field(default_factory=lambda: int(time()))
owned_by: str = "tabbyAPI"
parameters: Optional[ModelCardParameters] = None
class ModelList(BaseModel):
object: str = "list"
@@ -17,6 +24,7 @@ class DraftModelLoadRequest(BaseModel):
draft_rope_alpha: float = 1.0
draft_rope_scale: float = 1.0
# TODO: Unify this with ModelCardParams
class ModelLoadRequest(BaseModel):
name: str
max_seq_len: Optional[int] = 4096