mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-29 07:22:12 +03:00
wrap inflect in try catch
This commit is contained in:
@@ -236,8 +236,12 @@ def english_cleaners(text):
|
||||
text = collapse_whitespace(text)
|
||||
return text
|
||||
|
||||
try:
|
||||
_inflect = inflect.engine()
|
||||
except:
|
||||
print("inflect is not installed")
|
||||
_inflect = None
|
||||
|
||||
_inflect = inflect.engine()
|
||||
_comma_number_re = re.compile(r"([0-9][0-9\,]+[0-9])")
|
||||
_decimal_number_re = re.compile(r"([0-9]+\.[0-9]+)")
|
||||
_pounds_re = re.compile(r"£([0-9\,]*[0-9]+)")
|
||||
|
||||
Reference in New Issue
Block a user