Spaces:
Running
Running
aliasgerovs
commited on
Commit
·
d7f8207
1
Parent(s):
6a7f0e0
Update app.py
Browse files
app.py
CHANGED
@@ -275,7 +275,7 @@ def build_date(year, month, day):
|
|
275 |
|
276 |
def len_validator(text):
|
277 |
min_tokens = 128
|
278 |
-
tokenizer = AutoTokenizer('google-bert/bert-base-uncased')
|
279 |
lengt = len(tokenizer.tokenize(text = text, return_tensors="pt"))
|
280 |
if lengt < min_tokens:
|
281 |
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."
|
|
|
275 |
|
276 |
def len_validator(text):
|
277 |
min_tokens = 128
|
278 |
+
tokenizer = AutoTokenizer.from_pretrained('google-bert/bert-base-uncased')
|
279 |
lengt = len(tokenizer.tokenize(text = text, return_tensors="pt"))
|
280 |
if lengt < min_tokens:
|
281 |
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."
|