Update README.md
Browse files
README.md
CHANGED
@@ -66,7 +66,7 @@ def predict(path, sampling_rate):
|
|
66 |
logits = model(**inputs).logits
|
67 |
|
68 |
scores = F.softmax(logits, dim=1).detach().cpu().numpy()[0]
|
69 |
-
outputs = [{"
|
70 |
return outputs
|
71 |
```
|
72 |
|
|
|
66 |
logits = model(**inputs).logits
|
67 |
|
68 |
scores = F.softmax(logits, dim=1).detach().cpu().numpy()[0]
|
69 |
+
outputs = [{"Label": config.id2label[i], "Score": f"{round(score * 100, 3):.1f}%"} for i, score in enumerate(scores)]
|
70 |
return outputs
|
71 |
```
|
72 |
|