Skip to content

Commit 3d182ed

Browse files
committed
Fixes
1 parent e9ef0c1 commit 3d182ed

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import threading
44
import csv
55
import uuid
6+
from typing import Union, List, Optional
67

78
import torch
89
from fastapi import FastAPI, BackgroundTasks, HTTPException
@@ -159,14 +160,14 @@ class Feedback(BaseModel):
159160

160161
class 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")
172173
async def complete(

0 commit comments

Comments
 (0)