Spaces:
Running
Running
eljanmahammadli
commited on
Commit
·
3cc1430
1
Parent(s):
f293a91
Update app.py
Browse files
app.py
CHANGED
@@ -373,12 +373,12 @@ def build_date(year, month, day):
|
|
373 |
return f"{year}{months[month]}{day}"
|
374 |
|
375 |
def len_validator(text):
|
376 |
-
min_tokens =
|
377 |
lengt = len(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 :
|
381 |
-
return f"Input length is satisified."
|
382 |
|
383 |
def extract_text_from_pdf(pdf_path):
|
384 |
doc = fitz.open(pdf_path)
|
|
|
373 |
return f"{year}{months[month]}{day}"
|
374 |
|
375 |
def len_validator(text):
|
376 |
+
min_tokens = 200
|
377 |
lengt = len(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 :
|
381 |
+
return f"Input length ({lengt}) is satisified."
|
382 |
|
383 |
def extract_text_from_pdf(pdf_path):
|
384 |
doc = fitz.open(pdf_path)
|