Spaces:
Sleeping
Sleeping
Fixed progress bar
Browse files
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],
|