tomaszki commited on
Commit
421894c
·
1 Parent(s): 8f6976a

Quadratic and linear part for progress bar

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -36,8 +36,9 @@ def encode(text):
36
 
37
  # We can't run a single pass over all tokens, because
38
  # we get inconsistent results then
39
- for i in range(tokenized.shape[1]):
40
- bar.progress((i + 1) / tokenized.shape[1])
 
41
  with torch.no_grad():
42
  output_ = model(
43
  input_ids=tokenized[:, i:i + 1],
 
36
 
37
  # We can't run a single pass over all tokens, because
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],