Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -78,7 +78,7 @@ def stream_wp_token_ids():
|
|
| 78 |
|
| 79 |
def num_tokens(txt):
|
| 80 |
words = white_space_tokenizer(txt)
|
| 81 |
-
n_words = len(
|
| 82 |
try:
|
| 83 |
return f'Token count {len(ids)}, f-rate {len(ids)/n_words}'
|
| 84 |
except:
|
|
|
|
| 78 |
|
| 79 |
def num_tokens(txt):
|
| 80 |
words = white_space_tokenizer(txt)
|
| 81 |
+
n_words = len(words) if len(words) else 1
|
| 82 |
try:
|
| 83 |
return f'Token count {len(ids)}, f-rate {len(ids)/n_words}'
|
| 84 |
except:
|