fix: Fixed a `raise` statement (#30275)

* Fixed a raise statement.

* Minor changes.
This commit is contained in:
Sai-Suraj-27 2024-04-16 23:19:40 +05:30 committed by GitHub
parent c63f158903
commit 37b5946a66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -347,9 +347,11 @@ if __name__ == "__main__":
if args.convert_preprocessor:
try:
if not _is_package_available("tiktoken"):
raise """`tiktoken` is not installed, use `pip install tiktoken` to convert the tokenizer"""
except Exception:
pass
raise ModuleNotFoundError(
"""`tiktoken` is not installed, use `pip install tiktoken` to convert the tokenizer"""
)
except Exception as e:
print(e)
else:
from tiktoken.load import load_tiktoken_bpe