Skip to content

Commit

Permalink
add uvicorn server
Browse files Browse the repository at this point in the history
  • Loading branch information
listofbanned committed Oct 26, 2022
1 parent 3becbfe commit 07f14ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from models.blip import blip_decoder
from fastapi import FastAPI
import uvicorn


device = 'cuda:0'
Expand Down Expand Up @@ -52,3 +53,7 @@ async def exec_image_captioning(img_url: str):
return {'caption': caption[0]}
except Exception as e:
return {'Error': e}


if __name__ == '__main__':
uvicorn.run(app, host='0.0.0.0', port='8080')
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ transformers==4.15.0
fairscale==0.4.4
pycocoevalcap
fastapi
uvicorn

0 comments on commit 07f14ac

Please sign in to comment.