File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 33import threading
44import csv
55import uuid
6+ from typing import Union , List , Optional
67
78import torch
89from fastapi import FastAPI , BackgroundTasks , HTTPException
@@ -159,14 +160,14 @@ class Feedback(BaseModel):
159160
160161class OpenAICompletionRequest (BaseModel ):
161162 model : str
162- prompt : str | list [str ] = Field (..., description = "Either a string or a list of strings" )
163+ prompt : Union [ str , List [str ] ] = Field (..., description = "Either a string or a list of strings" )
163164 max_tokens : int = 40
164165 temperature : float = 1.0
165166 top_p : float = 1.0
166167 n : int = 1
167168 stream : bool = False
168- logprobs : int | None = None
169- stop : str | list [str ] | None = None # could be a single stop string or list of them
169+ logprobs : Optional [ int ] = None
170+ stop : Optional [ Union [ str , List [str ]]] = None
170171
171172@app .post ("/v1/completions" )
172173async def complete (
You can’t perform that action at this time.
0 commit comments