Spaces:
Runtime error
Runtime error
Update TextGen/__init__.py
Browse files- TextGen/__init__.py +8 -0
TextGen/__init__.py
CHANGED
|
@@ -1,6 +1,14 @@
|
|
| 1 |
from fastapi import FastAPI
|
|
|
|
| 2 |
|
| 3 |
app = FastAPI(title="Deploying FastAPI Apps on Huggingface")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
from TextGen import router
|
| 6 |
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
+
from fastapi.middleware.cors import CORSMiddleware
|
| 3 |
|
| 4 |
app = FastAPI(title="Deploying FastAPI Apps on Huggingface")
|
| 5 |
+
app.add_middleware(
|
| 6 |
+
CORSMiddleware,
|
| 7 |
+
allow_origins=["https://jofthomas-everchanging-quest.hf.space"],
|
| 8 |
+
allow_credentials=True,
|
| 9 |
+
allow_methods=["*"],
|
| 10 |
+
allow_headers=["*"],
|
| 11 |
+
)
|
| 12 |
|
| 13 |
from TextGen import router
|
| 14 |
|