Spaces:
Runtime error
Runtime error
victor commited on
Commit ·
9832cc7
1
Parent(s): 68bdf3d
refactor(app): allowing cors
Browse files123345667891011121314151617from fastapi import FastAPIfrom transformers import pipelinefrom fastapi.middleware.cors import CORSMiddleware
# Create a new FastAPI app instanceapp = FastAPI() origins = ["*"]app.add_middleware( CORSMiddleware, allow_origins=origins, allow_credentials=True, allow_methods=["*"], allow_headers=["*"],)# Initialize the text generation pipeline# This function will be able to generate text# given an input.app.py+10-2