Spaces:
Running
on
Zero
Running
on
Zero
Lord-Raven
commited on
Commit
·
6f85da5
1
Parent(s):
9cd8fce
Adding crunchatize.
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ app = FastAPI()
|
|
| 12 |
|
| 13 |
app.add_middleware(
|
| 14 |
CORSMiddleware,
|
| 15 |
-
allow_origins=["https://statosphere-3704059fdd7e.c5v4v4jx6pq5.win"],
|
| 16 |
allow_credentials=True,
|
| 17 |
allow_methods=["*"],
|
| 18 |
allow_headers=["*"],
|
|
@@ -37,7 +37,7 @@ classifier = pipeline(task="zero-shot-classification", model=model, tokenizer=to
|
|
| 37 |
def zero_shot_classification(data_string, request: gradio.Request):
|
| 38 |
if request:
|
| 39 |
print("Request headers dictionary:", request.headers)
|
| 40 |
-
if request.headers["origin"] not in ["https://statosphere-3704059fdd7e.c5v4v4jx6pq5.win", "https://jhuhman-statosphere-backend.hf.space"]:
|
| 41 |
return "{}"
|
| 42 |
print(data_string)
|
| 43 |
data = json.loads(data_string)
|
|
|
|
| 12 |
|
| 13 |
app.add_middleware(
|
| 14 |
CORSMiddleware,
|
| 15 |
+
allow_origins=["https://statosphere-3704059fdd7e.c5v4v4jx6pq5.win","https://crunchatize-77a78ffcc6a6.c5v4v4jx6pq5.win"],
|
| 16 |
allow_credentials=True,
|
| 17 |
allow_methods=["*"],
|
| 18 |
allow_headers=["*"],
|
|
|
|
| 37 |
def zero_shot_classification(data_string, request: gradio.Request):
|
| 38 |
if request:
|
| 39 |
print("Request headers dictionary:", request.headers)
|
| 40 |
+
if request.headers["origin"] not in ["https://statosphere-3704059fdd7e.c5v4v4jx6pq5.win", "https://crunchatize-77a78ffcc6a6.c5v4v4jx6pq5.win", "https://jhuhman-statosphere-backend.hf.space"]:
|
| 41 |
return "{}"
|
| 42 |
print(data_string)
|
| 43 |
data = json.loads(data_string)
|