Spaces:
Running
on
Zero
Running
on
Zero
Lord-Raven
commited on
Commit
·
320dce1
1
Parent(s):
50b814c
Experimenting with few-shot classification.
Browse files
app.py
CHANGED
@@ -66,9 +66,9 @@ def classify(data_string, request: gradio.Request):
|
|
66 |
if request.headers["origin"] not in ["https://statosphere-3704059fdd7e.c5v4v4jx6pq5.win", "https://crunchatize-77a78ffcc6a6.c5v4v4jx6pq5.win", "https://ravenok-statosphere-backend.hf.space"]:
|
67 |
return "{}"
|
68 |
data = json.loads(data_string)
|
69 |
-
if
|
70 |
return few_shot_classification
|
71 |
-
else
|
72 |
return zero_shot_classification
|
73 |
|
74 |
def zero_shot_classification(data):
|
|
|
66 |
if request.headers["origin"] not in ["https://statosphere-3704059fdd7e.c5v4v4jx6pq5.win", "https://crunchatize-77a78ffcc6a6.c5v4v4jx6pq5.win", "https://ravenok-statosphere-backend.hf.space"]:
|
67 |
return "{}"
|
68 |
data = json.loads(data_string)
|
69 |
+
if data['task'] == 'few_shot_classification':
|
70 |
return few_shot_classification
|
71 |
+
else:
|
72 |
return zero_shot_classification
|
73 |
|
74 |
def zero_shot_classification(data):
|