Spaces:
Runtime error
Runtime error
Commit
·
960495a
1
Parent(s):
5b2b4cb
tweak
Browse files
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
|
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 |
|