ka1kuk commited on
Commit
d2978b4
1 Parent(s): 6e99035

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +8 -0
main.py CHANGED
@@ -4,6 +4,14 @@ from Linlada import Chatbot, ConversationStyle
4
 
5
  app = FastAPI()
6
 
 
 
 
 
 
 
 
 
7
  async def generate(prompt):
8
  bot = await Chatbot.create()
9
  result = await bot.ask(prompt=prompt, conversation_style=ConversationStyle.precise)
 
4
 
5
  app = FastAPI()
6
 
7
+ app.add_middleware(
8
+ CORSMiddleware,
9
+ allow_origins=["*"],
10
+ allow_methods=["*"],
11
+ allow_headers=["*"],
12
+ allow_credentials=True,
13
+ )
14
+
15
  async def generate(prompt):
16
  bot = await Chatbot.create()
17
  result = await bot.ask(prompt=prompt, conversation_style=ConversationStyle.precise)