Lord-Raven commited on
Commit
df67acc
·
1 Parent(s): f6fc14b

Experimenting with few-shot classification.

Browse files
Files changed (1) hide show
  1. app.py +2 -4
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
- if 'task' in data and data['task'] == 'few_shot_classification':
66
- return few_shot_classification
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'])