Vitrous commited on
Commit
07066c9
·
verified ·
1 Parent(s): 37d83d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -15
app.py CHANGED
@@ -7,21 +7,7 @@ from transformers import (AutoModelForCausalLM, AutoTokenizer, LlamaForCausalLM,
7
  from fastapi.middleware.cors import CORSMiddleware
8
 
9
  app = FastAPI(title="Deploying FastAPI Apps on Huggingface")
10
- origins = [
11
- "https://articko-artickbot.hf.space",
12
- "https://articko-artickbot.hf.space/",
13
- "https://articko-artickbot.hf.space/api/start_conversation",
14
- "https://articko-artickbot.hf.space/api/get_response/",
15
- "https://127.0.0.1/",
16
- "https://127.0.0.1/api/",
17
- ]
18
- app.add_middleware(
19
- CORSMiddleware,
20
- allow_origins=origins,
21
- allow_credentials=True,
22
- allow_methods=["*"],
23
- allow_headers=["*"],
24
- )
25
 
26
 
27
  # Load the model and tokenizer
 
7
  from fastapi.middleware.cors import CORSMiddleware
8
 
9
  app = FastAPI(title="Deploying FastAPI Apps on Huggingface")
10
+ app.add_middleware(CORSMiddleware, allow_origins=['*'], allow_methods=['*'], allow_headers=['*'],)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
 
13
  # Load the model and tokenizer