Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -3,18 +3,18 @@ from fastapi.staticfiles import StaticFiles
|
|
| 3 |
from fastapi.responses import FileResponse
|
| 4 |
from transformers import pipeline
|
| 5 |
import torch
|
| 6 |
-
from fastapi.middleware.cors import CORSMiddleware
|
| 7 |
|
| 8 |
app = FastAPI()
|
| 9 |
|
| 10 |
# Enable CORS so your frontend can communicate with the backend smoothly
|
| 11 |
-
app.add_middleware(
|
| 12 |
-
CORSMiddleware,
|
| 13 |
-
allow_origins=["*"],
|
| 14 |
-
allow_credentials=True,
|
| 15 |
-
allow_methods=["*"],
|
| 16 |
-
allow_headers=["*"],
|
| 17 |
-
)
|
| 18 |
|
| 19 |
pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small")
|
| 20 |
|
|
|
|
| 3 |
from fastapi.responses import FileResponse
|
| 4 |
from transformers import pipeline
|
| 5 |
import torch
|
| 6 |
+
#from fastapi.middleware.cors import CORSMiddleware
|
| 7 |
|
| 8 |
app = FastAPI()
|
| 9 |
|
| 10 |
# Enable CORS so your frontend can communicate with the backend smoothly
|
| 11 |
+
#app.add_middleware(
|
| 12 |
+
# CORSMiddleware,
|
| 13 |
+
# allow_origins=["*"],
|
| 14 |
+
# allow_credentials=True,
|
| 15 |
+
# allow_methods=["*"],
|
| 16 |
+
# allow_headers=["*"],
|
| 17 |
+
#)
|
| 18 |
|
| 19 |
pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small")
|
| 20 |
|