Solving Bug
Browse files
app.py
CHANGED
|
@@ -21,7 +21,7 @@ if st.button("Predict"):
|
|
| 21 |
outputs = model(**inputs)
|
| 22 |
probs = F.softmax(outputs.logits, dim=-1)
|
| 23 |
top = torch.argmax(probs, dim=1).item()
|
| 24 |
-
label = model.config.id2label[
|
| 25 |
score = probs[0][top].item()
|
| 26 |
|
| 27 |
st.success(f"**Prediction**: {label} ({score:.4f})")
|
|
|
|
| 21 |
outputs = model(**inputs)
|
| 22 |
probs = F.softmax(outputs.logits, dim=-1)
|
| 23 |
top = torch.argmax(probs, dim=1).item()
|
| 24 |
+
label = model.config.id2label[top]
|
| 25 |
score = probs[0][top].item()
|
| 26 |
|
| 27 |
st.success(f"**Prediction**: {label} ({score:.4f})")
|