Skip to content

Commit 4a10e33

Browse files
committed
fix pydantic2 compatibility
1 parent fca4310 commit 4a10e33

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

run_wsgi.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class InfDetectBody(BaseModel):
1010
model_id: str
1111
data: List[str]
1212
src_type: str = "url"
13-
task: Union[str, List] # {key: embedding, ....}
13+
task: str
1414
labels: List[str]
1515
threshold: float = 0.1
1616
nms_threshold: float = 0.5
@@ -57,9 +57,9 @@ async def detect_urls(
5757
nms_threshold=body.nms_threshold,
5858
)
5959

60-
resp = DetectionRes(took=(time.time() - s_time) * 1000, objects=out)
60+
resp = DetectionRes(took=int((time.time() - s_time) * 1000), objects=out)
6161
return resp
6262

6363

6464
if __name__ == "__main__":
65-
uvicorn.run("wsgi:app", host="0.0.0.0", port=8000)
65+
uvicorn.run("run_wsgi:app", host="0.0.0.0", port=8000)

0 commit comments

Comments
 (0)