Some minor ergonomic changes for python backend

- Add validation rule to ensure  is set to fastertransformer or python-backend
- Add warning if model is unavailable, likely the user has not set  correctly

Signed-off-by: Parth Thakkar <thakkarparth007@gmail.com>
This commit is contained in:
Parth Thakkar 2023-01-02 18:54:51 +05:30
commit 4bf40cdb6c
3 changed files with 14 additions and 7 deletions

View file

@ -1,10 +1,10 @@
from typing import Optional, Union
from pydantic import BaseModel
from pydantic import BaseModel, constr
class OpenAIinput(BaseModel):
model: str = "fastertransformer"
model: constr(regex="^(fastertransformer|py-model)$") = "fastertransformer"
prompt: Optional[str]
suffix: Optional[str]
max_tokens: Optional[int] = 16