Skip to content

Commit

Permalink
fix: Fixed a raise statement (#30275)
Browse files Browse the repository at this point in the history
* Fixed a raise statement.

* Minor changes.
  • Loading branch information
Sai-Suraj-27 authored Apr 16, 2024
1 parent c63f158 commit 37b5946
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/transformers/models/whisper/convert_openai_to_hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,11 @@ def convert_tiktoken_to_hf(
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

Expand Down

0 comments on commit 37b5946

Please sign in to comment.