Spaces:
Running
on
Zero
Running
on
Zero
Lord-Raven
commited on
Commit
·
a19f98d
1
Parent(s):
c5cd62a
Adding Misty Mississippi to whitelist.
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ app = FastAPI()
|
|
14 |
|
15 |
app.add_middleware(
|
16 |
CORSMiddleware,
|
17 |
-
allow_origins=["https://statosphere-3704059fdd7e.c5v4v4jx6pq5.win","https://crunchatize-77a78ffcc6a6.c5v4v4jx6pq5.win","https://crunchatize-2-2b4f5b1479a6.c5v4v4jx6pq5.win","https://tamabotchi-2dba63df3bf1.c5v4v4jx6pq5.win","https://expressions-plus-plus-a8db5f0bd422.c5v4v4jx6pq5.win", "https://crunchatize-zero-55cf8960d31a.c5v4v4jx6pq5.win"],
|
18 |
allow_credentials=True,
|
19 |
allow_methods=["*"],
|
20 |
allow_headers=["*"],
|
@@ -36,7 +36,7 @@ classifier_gpu = pipeline(task="zero-shot-classification", model=model_name_gpu,
|
|
36 |
|
37 |
def classify(data_string, request: gradio.Request):
|
38 |
if request:
|
39 |
-
if request.headers["origin"] not in ["https://statosphere-3704059fdd7e.c5v4v4jx6pq5.win", "https://crunchatize-77a78ffcc6a6.c5v4v4jx6pq5.win", "https://crunchatize-2-2b4f5b1479a6.c5v4v4jx6pq5.win", "https://tamabotchi-2dba63df3bf1.c5v4v4jx6pq5.win", "https://expressions-plus-plus-a8db5f0bd422.c5v4v4jx6pq5.win", "https://crunchatize-zero-55cf8960d31a.c5v4v4jx6pq5.win", "https://ravenok-statosphere-backend.hf.space", "https://ravenok-test-space.hf.space", "https://lord-raven.github.io"]:
|
40 |
return "{}"
|
41 |
data = json.loads(data_string)
|
42 |
|
|
|
14 |
|
15 |
app.add_middleware(
|
16 |
CORSMiddleware,
|
17 |
+
allow_origins=["https://statosphere-3704059fdd7e.c5v4v4jx6pq5.win","https://crunchatize-77a78ffcc6a6.c5v4v4jx6pq5.win","https://crunchatize-2-2b4f5b1479a6.c5v4v4jx6pq5.win","https://tamabotchi-2dba63df3bf1.c5v4v4jx6pq5.win","https://expressions-plus-plus-a8db5f0bd422.c5v4v4jx6pq5.win", "https://crunchatize-zero-55cf8960d31a.c5v4v4jx6pq5.win", "https://misty-mississippi-87473a288fb9.c5v4v4jx6pq5.win"],
|
18 |
allow_credentials=True,
|
19 |
allow_methods=["*"],
|
20 |
allow_headers=["*"],
|
|
|
36 |
|
37 |
def classify(data_string, request: gradio.Request):
|
38 |
if request:
|
39 |
+
if request.headers["origin"] not in ["https://statosphere-3704059fdd7e.c5v4v4jx6pq5.win", "https://crunchatize-77a78ffcc6a6.c5v4v4jx6pq5.win", "https://crunchatize-2-2b4f5b1479a6.c5v4v4jx6pq5.win", "https://tamabotchi-2dba63df3bf1.c5v4v4jx6pq5.win", "https://expressions-plus-plus-a8db5f0bd422.c5v4v4jx6pq5.win", "https://crunchatize-zero-55cf8960d31a.c5v4v4jx6pq5.win", "https://misty-mississippi-87473a288fb9.c5v4v4jx6pq5.win", "https://ravenok-statosphere-backend.hf.space", "https://ravenok-test-space.hf.space", "https://lord-raven.github.io"]:
|
40 |
return "{}"
|
41 |
data = json.loads(data_string)
|
42 |
|