Spaces:
Running
on
Zero
Running
on
Zero
Lord-Raven
commited on
Commit
·
09439d2
1
Parent(s):
77ad4bb
Removing logging.
Browse files
app.py
CHANGED
@@ -36,12 +36,9 @@ classifier = pipeline(task="zero-shot-classification", model=model, tokenizer=to
|
|
36 |
|
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://ravenok-statosphere-backend.hf.space"]:
|
41 |
return "{}"
|
42 |
-
print(data_string)
|
43 |
data = json.loads(data_string)
|
44 |
-
print(data)
|
45 |
results = classifier(data['sequence'], candidate_labels=data['candidate_labels'], hypothesis_template=data['hypothesis_template'], multi_label=data['multi_label'])
|
46 |
response_string = json.dumps(results)
|
47 |
return response_string
|
|
|
36 |
|
37 |
def zero_shot_classification(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://ravenok-statosphere-backend.hf.space"]:
|
40 |
return "{}"
|
|
|
41 |
data = json.loads(data_string)
|
|
|
42 |
results = classifier(data['sequence'], candidate_labels=data['candidate_labels'], hypothesis_template=data['hypothesis_template'], multi_label=data['multi_label'])
|
43 |
response_string = json.dumps(results)
|
44 |
return response_string
|