TenzinGayche
commited on
Commit
·
4d2be3f
1
Parent(s):
61bebd5
Update handler.py
Browse files- handler.py +8 -0
handler.py
CHANGED
@@ -8,7 +8,15 @@ from transformers import SpeechT5Processor, SpeechT5ForTextToSpeech, SpeechT5Hif
|
|
8 |
from num2tib.core import convert
|
9 |
from num2tib.core import convert2text
|
10 |
import re
|
|
|
11 |
converter = pyewts.pyewts()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
def replace_numbers_with_convert(sentence, wylie=True):
|
13 |
pattern = r'\d+(\.\d+)?'
|
14 |
def replace(match):
|
|
|
8 |
from num2tib.core import convert
|
9 |
from num2tib.core import convert2text
|
10 |
import re
|
11 |
+
import requests
|
12 |
converter = pyewts.pyewts()
|
13 |
+
def download_file(url, destination):
|
14 |
+
response = requests.get(url)
|
15 |
+
with open(destination, 'wb') as file:
|
16 |
+
file.write(response.content)
|
17 |
+
|
18 |
+
# Example usage:
|
19 |
+
download_file('https://huggingface.co/openpecha/speecht5-tts-01/resolve/main/female_2.npy', 'female_2.npy')
|
20 |
def replace_numbers_with_convert(sentence, wylie=True):
|
21 |
pattern = r'\d+(\.\d+)?'
|
22 |
def replace(match):
|