Spaces:
Running
Running
eljanmahammadli
commited on
Commit
•
953f88a
1
Parent(s):
3cc1430
Update app.py
Browse files
app.py
CHANGED
@@ -374,7 +374,7 @@ def build_date(year, month, day):
|
|
374 |
|
375 |
def len_validator(text):
|
376 |
min_tokens = 200
|
377 |
-
lengt = len(
|
378 |
if lengt < min_tokens:
|
379 |
return f"Warning! Input length is {lengt}. Please input a text that is greater than {min_tokens} tokens long. Recommended length {min_tokens*2} tokens."
|
380 |
else :
|
|
|
374 |
|
375 |
def len_validator(text):
|
376 |
min_tokens = 200
|
377 |
+
lengt = len(text_bc_tokenizer.tokenize(text = text, return_tensors="pt"))
|
378 |
if lengt < min_tokens:
|
379 |
return f"Warning! Input length is {lengt}. Please input a text that is greater than {min_tokens} tokens long. Recommended length {min_tokens*2} tokens."
|
380 |
else :
|