tomaszki commited on
Commit
91f3bd7
·
1 Parent(s): 421894c

Fixed progress bar

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -38,7 +38,7 @@ def encode(text):
38
  # we get inconsistent results then
39
  length = tokenized.shape[1]
40
  for i in range(length):
41
- bar.progress((i + 1) + (i + 1) ** 2 / length)
42
  with torch.no_grad():
43
  output_ = model(
44
  input_ids=tokenized[:, i:i + 1],
 
38
  # we get inconsistent results then
39
  length = tokenized.shape[1]
40
  for i in range(length):
41
+ bar.progress(min(((i + 1) + (i + 1) ** 2 / 1000) / (length + length ** 2 // 1000), 1.0))
42
  with torch.no_grad():
43
  output_ = model(
44
  input_ids=tokenized[:, i:i + 1],