1NEYRON1 commited on
Commit
b48c5a3
·
1 Parent(s): ca15231

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -205,15 +205,15 @@ if st.button("Классифицировать"):
205
  cumulative_prob = 0
206
  t = 0.95
207
  try:
208
- if int(top):
209
- if (int(top) >= 0) and (int(top) <= 1):
210
- t = int(top)
211
- elif (int(top) > 1):
212
- t = int(top) / 100
213
  except ValueError:
214
  t = 0.95
215
 
216
- st.subheader(f'Результаты классификации (top {min(t * 100, 100)}%):')
217
  for label, score in results:
218
  st.write(f"- **{label}**: {score:.4f}")
219
  cumulative_prob += score
 
205
  cumulative_prob = 0
206
  t = 0.95
207
  try:
208
+ if float(top):
209
+ if (float(top) >= 0) and (float(top) <= 1):
210
+ t = float(top)
211
+ elif (float(top) > 1):
212
+ t = float(top) / 100
213
  except ValueError:
214
  t = 0.95
215
 
216
+ st.subheader(f'Результаты классификации (top {int(min(t * 100, 100))}%):')
217
  for label, score in results:
218
  st.write(f"- **{label}**: {score:.4f}")
219
  cumulative_prob += score