Spaces:
Runtime error
Runtime error
Updating max length to adjust for new model
Browse files
app.py
CHANGED
|
@@ -237,11 +237,11 @@ def reading_difficulty(excerpt):
|
|
| 237 |
windows = []
|
| 238 |
words = tokenizer.tokenize(excerpt)
|
| 239 |
|
| 240 |
-
if len(words) >
|
| 241 |
for idx, text in enumerate(words):
|
| 242 |
-
if idx %
|
| 243 |
-
if idx <= len(words) -
|
| 244 |
-
x = ' '.join(words[idx: idx +
|
| 245 |
windows.append(x)
|
| 246 |
|
| 247 |
win_preds = []
|
|
|
|
| 237 |
windows = []
|
| 238 |
words = tokenizer.tokenize(excerpt)
|
| 239 |
|
| 240 |
+
if len(words) > 500:
|
| 241 |
for idx, text in enumerate(words):
|
| 242 |
+
if idx % 500 == 0:
|
| 243 |
+
if idx <= len(words) - 501:
|
| 244 |
+
x = ' '.join(words[idx: idx + 499])
|
| 245 |
windows.append(x)
|
| 246 |
|
| 247 |
win_preds = []
|