Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,7 +26,7 @@ def predict_single_text(text):
|
|
| 26 |
with torch.no_grad():
|
| 27 |
logits = model(**inputs).logits
|
| 28 |
probs = torch.softmax(logits, dim=1)[0].tolist()
|
| 29 |
-
return {
|
| 30 |
|
| 31 |
def process_csv_file(file_obj):
|
| 32 |
"""The enterprise logic: CSV -> Classified CSV"""
|
|
|
|
| 26 |
with torch.no_grad():
|
| 27 |
logits = model(**inputs).logits
|
| 28 |
probs = torch.softmax(logits, dim=1)[0].tolist()
|
| 29 |
+
return {target_names[i]: v for i, v in enumerate(probs)}
|
| 30 |
|
| 31 |
def process_csv_file(file_obj):
|
| 32 |
"""The enterprise logic: CSV -> Classified CSV"""
|