RelativelyUnique commited on
Commit
960495a
·
1 Parent(s): 5b2b4cb
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -12,7 +12,7 @@ classifier = pipeline('text-classification', model = model, tokenizer=tokenizer,
12
  clf = lambda x: sorted(classifier(x)[0], key=lambda y: y['score'], reverse=True)
13
  gr_labels = lambda list_of_dicts: {d['label']: d['score'] for d in list_of_dicts}
14
 
15
- compose = lambda x: gr_labels(clf(x))
16
 
17
  demo = gr.Interface(fn=compose, inputs="text", outputs=gr.outputs.Label(num_top_classes=5))
18
 
 
12
  clf = lambda x: sorted(classifier(x)[0], key=lambda y: y['score'], reverse=True)
13
  gr_labels = lambda list_of_dicts: {d['label']: d['score'] for d in list_of_dicts}
14
 
15
+ compose = lambda description: gr_labels(clf(description))
16
 
17
  demo = gr.Interface(fn=compose, inputs="text", outputs=gr.outputs.Label(num_top_classes=5))
18