Spaces:
Runtime error
Runtime error
File size: 482 Bytes
89860e6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
from fastapi.middleware.cors import CORSMiddleware
from fastapi import FastAPI
import sentence_embeddings
app = FastAPI()
# CORS Support: https://stackoverflow.com/a/66460861
origins = ["*"]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(sentence_embeddings.router)
if __name__ == '__main__':
import uvicorn
uvicorn.run(app, host='0.0.0.0', port=8000)
|