feat(model): New metrics param to model API

This commit is contained in:
FangYin Cheng 2023-11-17 11:56:43 +08:00
parent 1240352e54
commit b45360441d
2 changed files with 4 additions and 0 deletions

View File

@ -54,6 +54,8 @@ class ModelOutput:
model_context: Dict = None
finish_reason: str = None
usage: Dict[str, Any] = None
metrics: Dict[str, Any] = None
"""Some metrics for model inference"""
def to_dict(self) -> Dict:
return asdict(self)

View File

@ -21,6 +21,8 @@ class PromptRequest(BaseModel):
context_len: int = None
echo: bool = True
span_id: str = None
metrics: bool = False
"""Whether to return metrics of inference"""
class EmbeddingsRequest(BaseModel):