Spaces:
Sleeping
Sleeping
Quadratic and linear part for progress bar
Browse files
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 |
-
|
| 40 |
-
|
|
|
|
| 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],
|