Spaces:
Sleeping
Sleeping
Commit
·
7791a85
1
Parent(s):
afc3372
fix bug: app.py (#1)
Browse files- fix bug: app.py (edf120af5d194f79c89adcd1ab9f43f6854c493b)
Co-authored-by: Oliver Huang <[email protected]>
app.py
CHANGED
@@ -27,8 +27,7 @@ model = model.to(device)
|
|
27 |
|
28 |
def single_sentence(sentence):
|
29 |
predictions = predict_single(sentence, tokenizer, model, device)
|
30 |
-
predictions
|
31 |
-
return list(zip(LABEL_COLUMNS, predictions))
|
32 |
|
33 |
def csv_process(csv_file, attr="content"):
|
34 |
current_time = datetime.now()
|
|
|
27 |
|
28 |
def single_sentence(sentence):
|
29 |
predictions = predict_single(sentence, tokenizer, model, device)
|
30 |
+
return sorted(zip(LABEL_COLUMNS, predictions), key=lambda x:x[-1], reverse=True)
|
|
|
31 |
|
32 |
def csv_process(csv_file, attr="content"):
|
33 |
current_time = datetime.now()
|