Spaces:
Runtime error
Runtime error
Update utils.py
Browse files
utils.py
CHANGED
|
@@ -16,7 +16,7 @@ def get_text(title: str, abstract: str):
|
|
| 16 |
def get_labels(text, model, tokenizer, count_labels=8):
|
| 17 |
tokens = tokenizer(text, return_tensors='pt')
|
| 18 |
outputs = model(**tokens)
|
| 19 |
-
probs = torch.nn.Softmax(dim=
|
| 20 |
|
| 21 |
labels = ['Computer_science', 'Economics',
|
| 22 |
'Electrical_Engineering_and_Systems_Science', 'Mathematics',
|
|
|
|
| 16 |
def get_labels(text, model, tokenizer, count_labels=8):
|
| 17 |
tokens = tokenizer(text, return_tensors='pt')
|
| 18 |
outputs = model(**tokens)
|
| 19 |
+
probs = torch.nn.Softmax(dim=1)(outputs.logits)
|
| 20 |
|
| 21 |
labels = ['Computer_science', 'Economics',
|
| 22 |
'Electrical_Engineering_and_Systems_Science', 'Mathematics',
|