Supports tokens and arrays of tokens as inputs to the OpenAI completion API (#715)

This commit is contained in:
WanMok
2023-08-11 12:14:34 -07:00
committed by GitHub
parent 462ae5220a
commit e06f504a76
2 changed files with 45 additions and 16 deletions
+2 -1
View File
@@ -74,7 +74,8 @@ class ChatCompletionRequest(BaseModel):
class CompletionRequest(BaseModel):
model: str
prompt: Union[str, List[str]]
# a string, array of strings, array of tokens, or array of token arrays
prompt: Union[List[int], List[List[int]], str, List[str]]
suffix: Optional[str] = None
max_tokens: Optional[int] = 16
temperature: Optional[float] = 1.0