João Pedro commited on
Commit
dafbc40
·
1 Parent(s): a3ab611

extract value from tensor

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -55,7 +55,7 @@ if uploaded_file:
55
  )
56
  st.text(f'encoding shape: {encoding}')
57
  outputs = model(**encoding)
58
- prediction = outputs.logits.argmax(-1)[0]
59
 
60
  # Display predictions (you may want to map indices to labels)
61
  st.write(f"Prediction: {id2label[prediction]}")
 
55
  )
56
  st.text(f'encoding shape: {encoding}')
57
  outputs = model(**encoding)
58
+ prediction = outputs.logits.argmax(-1)[0].item()
59
 
60
  # Display predictions (you may want to map indices to labels)
61
  st.write(f"Prediction: {id2label[prediction]}")