Bugfix: Stop sequences can be strings

This commit is contained in:
Andrei Betlen
2023-05-19 03:15:08 -04:00
parent f0812c4d8c
commit a8cd169251
2 changed files with 8 additions and 7 deletions

View File

@@ -1,4 +1,5 @@
import json
import logging
import multiprocessing
from threading import Lock
from typing import List, Optional, Union, Iterator, Dict
@@ -203,7 +204,7 @@ class CreateCompletionRequest(BaseModel):
default=False,
description="Whether to echo the prompt in the generated text. Useful for chatbots.",
)
stop: Optional[List[str]] = stop_field
stop: Optional[Union[str, List[str]]] = stop_field
stream: bool = stream_field
logprobs: Optional[int] = Field(
default=None,