Spaces:
Sleeping
Sleeping
allow all origins
Browse files- app/main.py +6 -0
app/main.py
CHANGED
|
@@ -6,6 +6,12 @@ from fastapi.staticfiles import StaticFiles
|
|
| 6 |
from starlette.responses import FileResponse
|
| 7 |
import os
|
| 8 |
app = FastAPI()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
os.environ['SENTENCE_TRANSFORMERS_HOME'] = './.cache' ## For Docker
|
| 10 |
app.mount("/files/", StaticFiles(directory='../code'), name="index")
|
| 11 |
class TextInput(BaseModel):
|
|
|
|
| 6 |
from starlette.responses import FileResponse
|
| 7 |
import os
|
| 8 |
app = FastAPI()
|
| 9 |
+
origins = [*]
|
| 10 |
+
|
| 11 |
+
app.add_middleware(
|
| 12 |
+
CORSMiddleware,
|
| 13 |
+
allow_origins=origins,
|
| 14 |
+
)
|
| 15 |
os.environ['SENTENCE_TRANSFORMERS_HOME'] = './.cache' ## For Docker
|
| 16 |
app.mount("/files/", StaticFiles(directory='../code'), name="index")
|
| 17 |
class TextInput(BaseModel):
|