mirror of
https://github.com/fauxpilot/fauxpilot.git
synced 2025-03-12 04:36:10 -07:00
- 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>
24 lines
667 B
Python
24 lines
667 B
Python
from typing import Optional, Union
|
|
|
|
from pydantic import BaseModel, constr
|
|
|
|
|
|
class OpenAIinput(BaseModel):
|
|
model: constr(regex="^(fastertransformer|py-model)$") = "fastertransformer"
|
|
prompt: Optional[str]
|
|
suffix: Optional[str]
|
|
max_tokens: Optional[int] = 16
|
|
temperature: Optional[float] = 0.6
|
|
top_p: Optional[float] = 1.0
|
|
n: Optional[int] = 1
|
|
stream: Optional[bool]
|
|
logprobs: Optional[int] = None
|
|
echo: Optional[bool]
|
|
stop: Optional[Union[str, list]]
|
|
presence_penalty: Optional[float] = 0
|
|
frequency_penalty: Optional[float] = 1
|
|
best_of: Optional[int] = 1
|
|
logit_bias: Optional[dict]
|
|
user: Optional[str]
|
|
|