Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -125,21 +125,19 @@ def inference():
|
|
125 |
final_outputs.extend(torch.sigmoid(outputs).cpu().detach().numpy().tolist())
|
126 |
return final_outputs, final_targets
|
127 |
|
128 |
-
|
129 |
prediction, targets = inference()
|
130 |
-
|
131 |
-
|
132 |
st.write(prediction)
|
133 |
st.write(targets)
|
134 |
|
|
|
135 |
targets = np.argmax(targets, axis=1)
|
136 |
prediction = np.argmax(prediction, axis=1)
|
137 |
-
|
138 |
-
|
139 |
-
f1_score_macro = metrics.f1_score(targets, prediction, average="macro")
|
140 |
|
|
|
|
|
|
|
141 |
st.write(prediction)
|
142 |
st.write(targets)
|
143 |
-
st.write(f"Accuracy Score = {accuracy}")
|
144 |
-
st.write(f"F1 Score (Micro) = {f1_score_micro}")
|
145 |
-
st.write(f"F1 Score (Macro) = {f1_score_macro}")
|
|
|
125 |
final_outputs.extend(torch.sigmoid(outputs).cpu().detach().numpy().tolist())
|
126 |
return final_outputs, final_targets
|
127 |
|
|
|
128 |
prediction, targets = inference()
|
129 |
+
st.write("before argmax")
|
|
|
130 |
st.write(prediction)
|
131 |
st.write(targets)
|
132 |
|
133 |
+
st.write("after argmax axis 1")
|
134 |
targets = np.argmax(targets, axis=1)
|
135 |
prediction = np.argmax(prediction, axis=1)
|
136 |
+
st.write(prediction)
|
137 |
+
st.write(targets)
|
|
|
138 |
|
139 |
+
st.write("after argmax axis 0")
|
140 |
+
targets = np.argmax(targets, axis=0)
|
141 |
+
prediction = np.argmax(prediction, axis=0)
|
142 |
st.write(prediction)
|
143 |
st.write(targets)
|
|
|
|
|
|