Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,7 @@ from fastapi import FastAPI, HTTPException
|
|
6 |
from PIL import Image
|
7 |
from pydantic import BaseModel
|
8 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
9 |
|
10 |
app = FastAPI()
|
11 |
|
@@ -54,3 +55,6 @@ def query(data: RequestData):
|
|
54 |
return {"response": str(response)}
|
55 |
except Exception as e:
|
56 |
raise HTTPException(status_code=500, detail=str(e))
|
|
|
|
|
|
|
|
6 |
from PIL import Image
|
7 |
from pydantic import BaseModel
|
8 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
9 |
+
import uvicorn
|
10 |
|
11 |
app = FastAPI()
|
12 |
|
|
|
55 |
return {"response": str(response)}
|
56 |
except Exception as e:
|
57 |
raise HTTPException(status_code=500, detail=str(e))
|
58 |
+
|
59 |
+
if __name__ == "__main__":
|
60 |
+
uvicorn.run(app:app)
|