Spaces:
Running
on
Zero
Running
on
Zero
Lord-Raven
commited on
Commit
·
df67acc
1
Parent(s):
f6fc14b
Experimenting with few-shot classification.
Browse files
app.py
CHANGED
@@ -62,10 +62,8 @@ def classify(data_string, request: gradio.Request):
|
|
62 |
if request.headers["origin"] not in ["https://statosphere-3704059fdd7e.c5v4v4jx6pq5.win", "https://crunchatize-77a78ffcc6a6.c5v4v4jx6pq5.win", "https://ravenok-statosphere-backend.hf.space"]:
|
63 |
return "{}"
|
64 |
data = json.loads(data_string)
|
65 |
-
|
66 |
-
|
67 |
-
else:
|
68 |
-
return zero_shot_classification
|
69 |
|
70 |
def zero_shot_classification(data):
|
71 |
results = classifier(data['sequence'], candidate_labels=data['candidate_labels'], hypothesis_template=data['hypothesis_template'], multi_label=data['multi_label'])
|
|
|
62 |
if request.headers["origin"] not in ["https://statosphere-3704059fdd7e.c5v4v4jx6pq5.win", "https://crunchatize-77a78ffcc6a6.c5v4v4jx6pq5.win", "https://ravenok-statosphere-backend.hf.space"]:
|
63 |
return "{}"
|
64 |
data = json.loads(data_string)
|
65 |
+
|
66 |
+
return zero_shot_classification
|
|
|
|
|
67 |
|
68 |
def zero_shot_classification(data):
|
69 |
results = classifier(data['sequence'], candidate_labels=data['candidate_labels'], hypothesis_template=data['hypothesis_template'], multi_label=data['multi_label'])
|