Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -28,8 +28,9 @@ cats = ["Computer Science", "Economics", "Electrical Engineering",
|
|
28 |
|
29 |
def predict(outputs):
|
30 |
top = 0
|
31 |
-
temp =
|
32 |
-
|
|
|
33 |
|
34 |
top_cats = []
|
35 |
top_probs = []
|
|
|
28 |
|
29 |
def predict(outputs):
|
30 |
top = 0
|
31 |
+
temp = 30000
|
32 |
+
apr_probs = torch.nn.functional.softmax(torch.tensor([39253., 84., 220., 2263., 1214., 909., 66., 10661.]) / temp, dim=0)
|
33 |
+
probs = nn.functional.softmax(outputs * apr_probs, dim=1).tolist()[0]
|
34 |
|
35 |
top_cats = []
|
36 |
top_probs = []
|