Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -635,7 +635,7 @@ def push_to_hub_after_training(model_path, username, model_name, token):
|
|
| 635 |
|
| 636 |
def count_tokens(text):
|
| 637 |
"""Count tokens in input text"""
|
| 638 |
-
if not text or CURRENT_TOKENIZER
|
| 639 |
return "Enter text to see token count"
|
| 640 |
tokens = CURRENT_TOKENIZER(text, truncation=False)
|
| 641 |
count = len(tokens['input_ids'])
|
|
|
|
| 635 |
|
| 636 |
def count_tokens(text):
|
| 637 |
"""Count tokens in input text"""
|
| 638 |
+
if not text or CURRENT_TOKENIZER === None:
|
| 639 |
return "Enter text to see token count"
|
| 640 |
tokens = CURRENT_TOKENIZER(text, truncation=False)
|
| 641 |
count = len(tokens['input_ids'])
|