Spaces:
Runtime error
Runtime error
victor commited on
Commit ·
9832cc7
1
Parent(s): 68bdf3d
refactor(app): allowing cors
Browse files123456789from fastapi import FastAPIfrom transformers import pipeline# Create a new FastAPI app instanceapp = FastAPI()# Initialize the text generation pipeline# This function will be able to generate text# given an input.1234567891011121314151617from 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