Spaces:
Running
on
Zero
Running
on
Zero
Serhiy Stetskovych
commited on
Commit
·
c1ee666
1
Parent(s):
e9b5617
More and better voices, faster because no diffusion at inferrence.
Browse files- app.py +41 -127
- voices/Гаська Шиян.wav → filatov.pt +2 -2
- requirements.txt +1 -1
- text_utils.py +0 -30
- verbalizer.py +107 -0
- voices/{Анастасія Павленко.wav → Інна Гелевера.pt} +2 -2
- voices/{Вʼячеслав Дудко.wav → Анастасія Павленко.pt} +2 -2
- voices/{Влада Муравець.wav → Артем Окороков.pt} +2 -2
- voices/Вʼячеслав Дудко.pt +3 -0
- voices/Вероніка Дорош.pt +3 -0
- voices/Влада Муравець.pt +3 -0
- voices/Вікторія Левченко.pt +3 -0
- voices/Гаська Шиян.pt +3 -0
- voices/Денис Денисенко.pt +3 -0
- voices/Катерина Потапенко.pt +3 -0
- voices/Катерина Потапенко.wav +0 -3
- voices/Кирило Татарченко.pt +3 -0
- voices/Людмила Чиркова.pt +3 -0
- voices/Марина Панас.pt +3 -0
- voices/Марина Панас.wav +0 -3
- voices/Марися Нікітюк.pt +3 -0
- voices/Марися Нікітюк.wav +0 -3
- voices/Марта Мольфар.pt +3 -0
- voices/Марта Мольфар.wav +0 -3
- voices/Марічка Штирбулова.pt +3 -0
- voices/Марічка Штирбулова.wav +0 -3
- voices/Маслінка.wav +0 -3
- voices/Матвій Ніколаєв.pt +3 -0
- voices/Матвій Ніколаєв.wav +0 -3
- voices/Михайло Тишин.pt +3 -0
- voices/Михайло Тишин.wav +0 -3
- voices/Наталія Калюжна.wav +0 -3
- voices/Олег Лепенець.wav +0 -3
- voices/Олександр Ролдугін.pt +3 -0
- voices/Олена Шверк.pt +3 -0
- voices/Павло Буковський.pt +3 -0
- voices/Петро Філяк.pt +3 -0
- voices/Поліна Еккерт(хлопчик).pt +3 -0
- voices/Поліна Еккерт.pt +3 -0
- voices/Роман Куліш.pt +3 -0
- voices/Слава Красовська.pt +3 -0
- voices/Слава Красовська.wav +0 -3
- voices/Тарас Василюк.pt +3 -0
- voices/Тетяна Гончарова.pt +3 -0
- voices/Тетяна Лукинюк.pt +3 -0
- voices/Юрій Вихованець.pt +3 -0
- voices/Юрій Кудрявець.pt +3 -0
- voices/Юрій Кудрявець.wav +0 -3
- voices/Яніна Соколова.wav +0 -3
app.py
CHANGED
@@ -2,84 +2,22 @@ import glob
|
|
2 |
import os
|
3 |
import re
|
4 |
import gradio as gr
|
5 |
-
|
6 |
import spaces
|
7 |
-
from
|
8 |
-
|
9 |
-
import numpy as np
|
10 |
import torch
|
11 |
from ipa_uk import ipa
|
12 |
from unicodedata import normalize
|
13 |
from styletts2_inference.models import StyleTTS2
|
14 |
from ukrainian_word_stress import Stressifier
|
15 |
stressify = Stressifier()
|
16 |
-
from text_utils import TextCleaner
|
17 |
-
textclenaer = TextCleaner()
|
18 |
|
19 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
20 |
|
21 |
prompts_dir = 'voices'
|
22 |
-
prompts_list = sorted(glob.glob(os.path.join(prompts_dir, '*.wav')))
|
23 |
-
prompts_list = ['.'.join(p.split('/')[-1].split('.')[:-1]) for p in prompts_list]
|
24 |
-
|
25 |
-
verbalizer_model_name = "skypro1111/mbart-large-50-verbalization"
|
26 |
-
|
27 |
-
def cache_model_from_hf(repo_id, model_dir="./"):
|
28 |
-
"""Download ONNX models from HuggingFace Hub."""
|
29 |
-
files = ["onnx/encoder_model.onnx", "onnx/decoder_model.onnx", "onnx/decoder_model.onnx_data"]
|
30 |
-
|
31 |
-
for file in files:
|
32 |
-
hf_hub_download(
|
33 |
-
repo_id=repo_id,
|
34 |
-
filename=file,
|
35 |
-
local_dir=model_dir,
|
36 |
-
)
|
37 |
-
|
38 |
-
|
39 |
-
def create_onnx_session(model_path, use_gpu=True):
|
40 |
-
"""Create an ONNX inference session."""
|
41 |
-
session_options = onnxruntime.SessionOptions()
|
42 |
-
session_options.graph_optimization_level = onnxruntime.GraphOptimizationLevel.ORT_ENABLE_ALL
|
43 |
-
session_options.enable_mem_pattern = True
|
44 |
-
session_options.enable_mem_reuse = True
|
45 |
-
session_options.intra_op_num_threads = 8
|
46 |
-
session_options.log_severity_level = 1
|
47 |
-
|
48 |
-
cuda_provider_options = {
|
49 |
-
'device_id': 0,
|
50 |
-
'arena_extend_strategy': 'kSameAsRequested',
|
51 |
-
'gpu_mem_limit': 0, # 0 means no limit
|
52 |
-
'cudnn_conv_algo_search': 'DEFAULT',
|
53 |
-
'do_copy_in_default_stream': True,
|
54 |
-
}
|
55 |
-
|
56 |
-
if use_gpu and 'CUDAExecutionProvider' in onnxruntime.get_available_providers():
|
57 |
-
providers = [('CUDAExecutionProvider', cuda_provider_options)]
|
58 |
-
else:
|
59 |
-
providers = ['CPUExecutionProvider']
|
60 |
-
|
61 |
-
session = onnxruntime.InferenceSession(
|
62 |
-
model_path,
|
63 |
-
providers=providers,
|
64 |
-
sess_options=session_options
|
65 |
-
)
|
66 |
-
|
67 |
-
return session
|
68 |
-
|
69 |
-
def init_verbalizer():
|
70 |
-
cache_model_from_hf(verbalizer_model_name)
|
71 |
-
|
72 |
-
print("Loading tokenizer...")
|
73 |
-
tokenizer = AutoTokenizer.from_pretrained(verbalizer_model_name)
|
74 |
-
tokenizer.src_lang = "uk_UA"
|
75 |
-
tokenizer.tgt_lang = "uk_UA"
|
76 |
-
|
77 |
-
print("Creating ONNX sessions...")
|
78 |
-
encoder_session = create_onnx_session("onnx/encoder_model.onnx")
|
79 |
-
decoder_session = create_onnx_session("onnx/decoder_model.onnx")
|
80 |
-
return tokenizer, encoder_session, decoder_session
|
81 |
|
82 |
-
|
83 |
|
84 |
|
85 |
def split_to_parts(text):
|
@@ -95,55 +33,31 @@ def split_to_parts(text):
|
|
95 |
|
96 |
|
97 |
|
98 |
-
|
99 |
-
|
100 |
-
'single': StyleTTS2(hf_path='patriotyk/styletts2_ukrainian_single', device=device)
|
101 |
-
}
|
102 |
|
103 |
|
|
|
|
|
104 |
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
# Generate sequence
|
125 |
-
for _ in range(512):
|
126 |
-
# Run decoder
|
127 |
-
decoder_outputs = decoder_session.run(
|
128 |
-
output_names=["logits"],
|
129 |
-
input_feed={
|
130 |
-
"input_ids": decoder_input_ids,
|
131 |
-
"encoder_hidden_states": encoder_outputs,
|
132 |
-
"encoder_attention_mask": attention_mask,
|
133 |
-
}
|
134 |
-
)[0]
|
135 |
-
|
136 |
-
# Get next token
|
137 |
-
next_token = decoder_outputs[:, -1:].argmax(axis=-1)
|
138 |
-
decoder_input_ids = np.concatenate([decoder_input_ids, next_token], axis=-1)
|
139 |
-
|
140 |
-
# Check if sequence is complete
|
141 |
-
if tokenizer.eos_token_id in decoder_input_ids[0]:
|
142 |
-
break
|
143 |
-
|
144 |
-
# Decode sequence
|
145 |
-
output_text = tokenizer.decode(decoder_input_ids[0], skip_special_tokens=True)
|
146 |
-
return output_text
|
147 |
|
148 |
|
149 |
@spaces.GPU
|
@@ -151,14 +65,16 @@ def verbalize(text):
|
|
151 |
parts = split_to_parts(text)
|
152 |
verbalized = ''
|
153 |
for part in parts:
|
154 |
-
verbalized += generate_text(part)
|
155 |
return verbalized
|
156 |
|
157 |
description = f'''
|
158 |
<h1 style="text-align:center;">StyleTTS2 ukrainian demo</h1><br>
|
159 |
-
Програма може не коректно визначати деякі
|
160 |
Якщо наголос не правильний, використовуйте символ + після наголошеного складу.
|
161 |
-
|
|
|
|
|
162 |
|
163 |
'''
|
164 |
|
@@ -173,7 +89,7 @@ examples = [
|
|
173 |
|
174 |
|
175 |
@spaces.GPU
|
176 |
-
def synthesize(model_name, text, speed,
|
177 |
|
178 |
if text.strip() == "":
|
179 |
raise gr.Error("You must enter some text")
|
@@ -183,14 +99,7 @@ def synthesize(model_name, text, speed, voice_audio = None, progress=gr.Progress
|
|
183 |
print(text)
|
184 |
print("*** end ***")
|
185 |
|
186 |
-
|
187 |
-
voice = None
|
188 |
-
if voice_audio:
|
189 |
-
prompt_audio_path = os.path.join(prompts_dir, voice_audio+'.wav')
|
190 |
-
voice = models[model_name].compute_style(prompt_audio_path)
|
191 |
-
diffusion_steps = 10
|
192 |
-
|
193 |
-
s_prev = torch.tensor([[0]])
|
194 |
result_wav = []
|
195 |
for t in progress.tqdm(split_to_parts(text)):
|
196 |
|
@@ -204,9 +113,14 @@ def synthesize(model_name, text, speed, voice_audio = None, progress=gr.Progress
|
|
204 |
t = re.sub(r' - ', ': ', t)
|
205 |
ps = ipa(stressify(t))
|
206 |
|
207 |
-
|
208 |
-
|
209 |
-
|
|
|
|
|
|
|
|
|
|
|
210 |
result_wav.append(wav)
|
211 |
|
212 |
|
|
|
2 |
import os
|
3 |
import re
|
4 |
import gradio as gr
|
5 |
+
|
6 |
import spaces
|
7 |
+
from verbalizer import Verbalizer
|
8 |
+
|
|
|
9 |
import torch
|
10 |
from ipa_uk import ipa
|
11 |
from unicodedata import normalize
|
12 |
from styletts2_inference.models import StyleTTS2
|
13 |
from ukrainian_word_stress import Stressifier
|
14 |
stressify = Stressifier()
|
|
|
|
|
15 |
|
16 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
17 |
|
18 |
prompts_dir = 'voices'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
+
verbalizer = Verbalizer(device=device)
|
21 |
|
22 |
|
23 |
def split_to_parts(text):
|
|
|
33 |
|
34 |
|
35 |
|
36 |
+
single_model = StyleTTS2(hf_path='patriotyk/styletts2_ukrainian_single', device=device)
|
37 |
+
single_style = torch.load('filatov.pt')
|
|
|
|
|
38 |
|
39 |
|
40 |
+
multi_model = StyleTTS2(hf_path='patriotyk/styletts2_ukrainian_multispeaker', device=device)
|
41 |
+
multi_styles = {}
|
42 |
|
43 |
+
prompts_list = sorted(glob.glob(os.path.join(prompts_dir, '*.pt')))
|
44 |
+
prompts_list = ['.'.join(p.split('/')[-1].split('.')[:-1]) for p in prompts_list]
|
45 |
+
|
46 |
+
for audio_prompt in prompts_list:
|
47 |
+
audio_path = os.path.join(prompts_dir, audio_prompt+'.pt')
|
48 |
+
multi_styles[audio_prompt] = torch.load(audio_path)
|
49 |
+
print('loaded ', audio_prompt)
|
50 |
+
|
51 |
+
models = {
|
52 |
+
'multi': {
|
53 |
+
'model': multi_model,
|
54 |
+
'styles': multi_styles
|
55 |
+
},
|
56 |
+
'single': {
|
57 |
+
'model': single_model,
|
58 |
+
'style': single_style
|
59 |
+
}
|
60 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
|
63 |
@spaces.GPU
|
|
|
65 |
parts = split_to_parts(text)
|
66 |
verbalized = ''
|
67 |
for part in parts:
|
68 |
+
verbalized += verbalizer.generate_text(part)
|
69 |
return verbalized
|
70 |
|
71 |
description = f'''
|
72 |
<h1 style="text-align:center;">StyleTTS2 ukrainian demo</h1><br>
|
73 |
+
Програма може не коректно визначати деякі наголоси.
|
74 |
Якщо наголос не правильний, використовуйте символ + після наголошеного складу.
|
75 |
+
Текст який складається з одного слова може синтезуватися з певними артефактами, пишіть повноцінні речення.
|
76 |
+
Якщо текст містить цифри чи акроніми, можна натисну кнопку "Вербалізувати" яка повинна замінити цифри і акроніми
|
77 |
+
в словесну форму.
|
78 |
|
79 |
'''
|
80 |
|
|
|
89 |
|
90 |
|
91 |
@spaces.GPU
|
92 |
+
def synthesize(model_name, text, speed, voice_name = None, progress=gr.Progress()):
|
93 |
|
94 |
if text.strip() == "":
|
95 |
raise gr.Error("You must enter some text")
|
|
|
99 |
print(text)
|
100 |
print("*** end ***")
|
101 |
|
102 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
result_wav = []
|
104 |
for t in progress.tqdm(split_to_parts(text)):
|
105 |
|
|
|
113 |
t = re.sub(r' - ', ': ', t)
|
114 |
ps = ipa(stressify(t))
|
115 |
|
116 |
+
if ps:
|
117 |
+
tokens = models[model_name]['model'].tokenizer.encode(ps)
|
118 |
+
if voice_name:
|
119 |
+
style = models[model_name]['styles'][voice_name]
|
120 |
+
else:
|
121 |
+
style = models[model_name]['style']
|
122 |
+
|
123 |
+
wav = models[model_name]['model'](tokens, speed=speed, s_prev=style)
|
124 |
result_wav.append(wav)
|
125 |
|
126 |
|
voices/Гаська Шиян.wav → filatov.pt
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f181646626df52fdcf749e93a311686ffb2eaeae8112be0005a8d6efa7dc5cc9
|
3 |
+
size 2204
|
requirements.txt
CHANGED
@@ -10,7 +10,7 @@ torch==2.2.0
|
|
10 |
transformers
|
11 |
git+https://github.com/patriotyk/ukrainian-word-stress.git
|
12 |
git+https://github.com/patriotyk/ipa-uk.git
|
13 |
-
git+https://github.com/patriotyk/styletts2-inference
|
14 |
spaces
|
15 |
numpy<2
|
16 |
huggingface_hub
|
|
|
10 |
transformers
|
11 |
git+https://github.com/patriotyk/ukrainian-word-stress.git
|
12 |
git+https://github.com/patriotyk/ipa-uk.git
|
13 |
+
git+https://github.com/patriotyk/styletts2-inference
|
14 |
spaces
|
15 |
numpy<2
|
16 |
huggingface_hub
|
text_utils.py
DELETED
@@ -1,30 +0,0 @@
|
|
1 |
-
|
2 |
-
_pad = "$"
|
3 |
-
_punctuation = '-´;:,.!?¡¿—…"«»“” ()†/='
|
4 |
-
_letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
|
5 |
-
_letters_ipa = "éýíó'̯'͡ɑɐɒæɓʙβɔɕçɗɖðʤəɘɚɛɜɝɞɟʄɡɠɢʛɦɧħɥʜɨɪʝɭɬɫɮʟɱɯɰŋɳɲɴøɵɸθœɶʘɹɺɾɻʀʁɽʂʃʈʧʉʊʋⱱʌɣɤʍχʎʏʑʐʒʔʡʕʢǀǁǂǃˈˌːˑʼʴʰʱʲ'̩'ᵻ"
|
6 |
-
|
7 |
-
|
8 |
-
# Export all symbols:
|
9 |
-
symbols = [_pad] + list(_punctuation) + list(_letters) + list(_letters_ipa)
|
10 |
-
|
11 |
-
letters = list(_letters) + list(_letters_ipa)
|
12 |
-
|
13 |
-
dicts = {}
|
14 |
-
for i in range(len((symbols))):
|
15 |
-
dicts[symbols[i]] = i
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
class TextCleaner:
|
20 |
-
def __init__(self, dummy=None):
|
21 |
-
self.word_index_dictionary = dicts
|
22 |
-
print(len(dicts))
|
23 |
-
def __call__(self, text):
|
24 |
-
indexes = []
|
25 |
-
for char in text:
|
26 |
-
try:
|
27 |
-
indexes.append(self.word_index_dictionary[char])
|
28 |
-
except KeyError:
|
29 |
-
print(text)
|
30 |
-
return indexes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
verbalizer.py
ADDED
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import onnxruntime
|
2 |
+
import numpy as np
|
3 |
+
from transformers import AutoTokenizer
|
4 |
+
from huggingface_hub import hf_hub_download
|
5 |
+
|
6 |
+
verbalizer_model_name = "skypro1111/mbart-large-50-verbalization"
|
7 |
+
|
8 |
+
def cache_model_from_hf(repo_id, model_dir="./"):
|
9 |
+
"""Download ONNX models from HuggingFace Hub."""
|
10 |
+
files = ["onnx/encoder_model.onnx", "onnx/decoder_model.onnx", "onnx/decoder_model.onnx_data"]
|
11 |
+
|
12 |
+
for file in files:
|
13 |
+
hf_hub_download(
|
14 |
+
repo_id=repo_id,
|
15 |
+
filename=file,
|
16 |
+
local_dir=model_dir,
|
17 |
+
)
|
18 |
+
|
19 |
+
|
20 |
+
|
21 |
+
class Verbalizer():
|
22 |
+
def __init__(self, device):
|
23 |
+
cache_model_from_hf(verbalizer_model_name)
|
24 |
+
|
25 |
+
print("Loading tokenizer...")
|
26 |
+
self.tokenizer = AutoTokenizer.from_pretrained(verbalizer_model_name)
|
27 |
+
self.tokenizer.src_lang = "uk_UA"
|
28 |
+
self.tokenizer.tgt_lang = "uk_UA"
|
29 |
+
|
30 |
+
print("Creating ONNX sessions...")
|
31 |
+
self.encoder_session = self.create_onnx_session("onnx/encoder_model.onnx", device=='cuda')
|
32 |
+
self.decoder_session = self.create_onnx_session("onnx/decoder_model.onnx", device=='cuda')
|
33 |
+
|
34 |
+
|
35 |
+
def create_onnx_session(self, model_path, use_gpu=True):
|
36 |
+
"""Create an ONNX inference session."""
|
37 |
+
session_options = onnxruntime.SessionOptions()
|
38 |
+
session_options.graph_optimization_level = onnxruntime.GraphOptimizationLevel.ORT_ENABLE_ALL
|
39 |
+
session_options.enable_mem_pattern = True
|
40 |
+
session_options.enable_mem_reuse = True
|
41 |
+
session_options.intra_op_num_threads = 8
|
42 |
+
#session_options.log_severity_level = 1
|
43 |
+
|
44 |
+
cuda_provider_options = {
|
45 |
+
'device_id': 0,
|
46 |
+
'arena_extend_strategy': 'kSameAsRequested',
|
47 |
+
'gpu_mem_limit': 0, # 0 means no limit
|
48 |
+
'cudnn_conv_algo_search': 'DEFAULT',
|
49 |
+
'do_copy_in_default_stream': True,
|
50 |
+
}
|
51 |
+
|
52 |
+
if use_gpu and 'CUDAExecutionProvider' in onnxruntime.get_available_providers():
|
53 |
+
providers = [('CUDAExecutionProvider', cuda_provider_options)]
|
54 |
+
else:
|
55 |
+
providers = ['CPUExecutionProvider']
|
56 |
+
|
57 |
+
session = onnxruntime.InferenceSession(
|
58 |
+
model_path,
|
59 |
+
providers=providers,
|
60 |
+
sess_options=session_options
|
61 |
+
)
|
62 |
+
|
63 |
+
return session
|
64 |
+
|
65 |
+
|
66 |
+
def generate_text(self, text):
|
67 |
+
"""Generate text for a single input."""
|
68 |
+
# Prepare input
|
69 |
+
inputs = self.tokenizer(text, return_tensors="np", padding=True, truncation=True, max_length=512)
|
70 |
+
input_ids = inputs["input_ids"].astype(np.int64)
|
71 |
+
attention_mask = inputs["attention_mask"].astype(np.int64)
|
72 |
+
|
73 |
+
# Run encoder
|
74 |
+
encoder_outputs = self.encoder_session.run(
|
75 |
+
output_names=["last_hidden_state"],
|
76 |
+
input_feed={
|
77 |
+
"input_ids": input_ids,
|
78 |
+
"attention_mask": attention_mask,
|
79 |
+
}
|
80 |
+
)[0]
|
81 |
+
|
82 |
+
# Initialize decoder input
|
83 |
+
decoder_input_ids = np.array([[self.tokenizer.pad_token_id]], dtype=np.int64)
|
84 |
+
|
85 |
+
# Generate sequence
|
86 |
+
for _ in range(512):
|
87 |
+
# Run decoder
|
88 |
+
decoder_outputs = self.decoder_session.run(
|
89 |
+
output_names=["logits"],
|
90 |
+
input_feed={
|
91 |
+
"input_ids": decoder_input_ids,
|
92 |
+
"encoder_hidden_states": encoder_outputs,
|
93 |
+
"encoder_attention_mask": attention_mask,
|
94 |
+
}
|
95 |
+
)[0]
|
96 |
+
|
97 |
+
# Get next token
|
98 |
+
next_token = decoder_outputs[:, -1:].argmax(axis=-1)
|
99 |
+
decoder_input_ids = np.concatenate([decoder_input_ids, next_token], axis=-1)
|
100 |
+
|
101 |
+
# Check if sequence is complete
|
102 |
+
if self.tokenizer.eos_token_id in decoder_input_ids[0]:
|
103 |
+
break
|
104 |
+
|
105 |
+
# Decode sequence
|
106 |
+
output_text = self.tokenizer.decode(decoder_input_ids[0], skip_special_tokens=True)
|
107 |
+
return output_text
|
voices/{Анастасія Павленко.wav → Інна Гелевера.pt}
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5491e3db2777dcf6a9d3512559dbb09c5a77908a7227c026f1a519ee3ef7126a
|
3 |
+
size 2239
|
voices/{Вʼячеслав Дудко.wav → Анастасія Павленко.pt}
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f350b92baf668c303987fb7d9981422a1999956a9192518099f2f8382dc49aae
|
3 |
+
size 2204
|
voices/{Влада Муравець.wav → Артем Окороков.pt}
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:da04c5c100381147c7b42e849ea9da6136183d0ed267dbed4cc1c44dfde11fff
|
3 |
+
size 2239
|
voices/Вʼячеслав Дудко.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f4802234aa77796e78f6622f9dfda745bfeb53cff62f81fcefa45cd07b268a61
|
3 |
+
size 2204
|
voices/Вероніка Дорош.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e5626b54e84a37f1c7e19605cdc90f010bbc8915ac3435093795405c7e1a9e80
|
3 |
+
size 2239
|
voices/Влада Муравець.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ba5509c7432d4fed194e9fc62b0de88e5f8a3fba59d1e104e4f1943e3e59f6bd
|
3 |
+
size 2204
|
voices/Вікторія Левченко.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b5161f5ca699944f5d9d29e748f4d341b7fce1857ae896bf999d7cee2c4bc6bf
|
3 |
+
size 2239
|
voices/Гаська Шиян.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:693e018423188f0ba9ccd199bedfb9852224d27f190d180a7013e0e404ea808e
|
3 |
+
size 2204
|
voices/Денис Денисенко.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e9d7511fc875ef91182de360765ff87db975fcbaae28e33e115825e44c7622dc
|
3 |
+
size 2239
|
voices/Катерина Потапенко.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c0932a415d647cd01767be9147e6fd801f8d1af01c4a77845583813963859605
|
3 |
+
size 2204
|
voices/Катерина Потапенко.wav
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:8e7bca8d0b0dc6cb95e7456013bb463058fd37ddbc9cd5e10b0980c6a021ea4a
|
3 |
-
size 945388
|
|
|
|
|
|
|
|
voices/Кирило Татарченко.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5417c242cbb38c9833382c68bf7a0320de49cb4fa2bd31b02463042162ed2413
|
3 |
+
size 2239
|
voices/Людмила Чиркова.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c0e0e521c20a876aa1d4de5d6c23a51e73478ebfb55d4b33129b28ad9189d97a
|
3 |
+
size 2239
|
voices/Марина Панас.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e4d82990dfc3548e09410f6d7108bda88b70116a42852cc97e2013583fefc29e
|
3 |
+
size 2204
|
voices/Марина Панас.wav
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:720d617b7b377e15ac710171670eae69437276ffacdc8339113dfb2717233a46
|
3 |
-
size 918988
|
|
|
|
|
|
|
|
voices/Марися Нікітюк.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d8e7d4de0bd24d018f3678464f93e0b212758daf0dbcc0b3bccfd00133c13072
|
3 |
+
size 2204
|
voices/Марися Нікітюк.wav
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:acd17f7cb865d102d7a811f98e45a7baf6f1665c222fd84045932612764f2eee
|
3 |
-
size 926188
|
|
|
|
|
|
|
|
voices/Марта Мольфар.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ff4596e0c1f79f25cbb4c413a2f709bcffd95108bd9c4f3f9c936ad90df8769c
|
3 |
+
size 2204
|
voices/Марта Мольфар.wav
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:52adad6d28328ab05a602dfcba768defcc8e7aa34d00c3e85416a4d6151b2535
|
3 |
-
size 748588
|
|
|
|
|
|
|
|
voices/Марічка Штирбулова.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a4ead4f661d13313f51b1e1a264674fb8670c2ba193aa22e391266939577b23a
|
3 |
+
size 2204
|
voices/Марічка Штирбулова.wav
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:d6ef6573f3c777d2f79d4afc1e8936da2c02ce47559e34962f97efc9242ba39b
|
3 |
-
size 1600588
|
|
|
|
|
|
|
|
voices/Маслінка.wav
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:7e513b693af42afe49efb170ffc4e3d07bfb609ccb8b4b7ea3f9932be57dad5f
|
3 |
-
size 942988
|
|
|
|
|
|
|
|
voices/Матвій Ніколаєв.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:41fe7d4d09a91365a7df02387baffdd027496574af5c9b74e13b5b1783383460
|
3 |
+
size 2204
|
voices/Матвій Ніколаєв.wav
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:0d699c90a21afdd4014c88c25bc283f9c3221e453cdb1c79ad358e69429e4ee1
|
3 |
-
size 885388
|
|
|
|
|
|
|
|
voices/Михайло Тишин.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e4d63727d1aa6cfda4329e6e3d44eabb52759554a92801c028ca38d33e9d55fc
|
3 |
+
size 2204
|
voices/Михайло Тишин.wav
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:074124a743764ba7de24a0d1d3c320f2871b4324d74ba0073a7691cee6dee905
|
3 |
-
size 897388
|
|
|
|
|
|
|
|
voices/Наталія Калюжна.wav
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:6dda18ff38e4858e7f562b4975b48572d3f7f89b5ec367d2a9b04b90841d79ba
|
3 |
-
size 1041388
|
|
|
|
|
|
|
|
voices/Олег Лепенець.wav
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:f86bb5aa40ec6d5c79fd22ced1bbe8da0b8c11fe89bbe5ebfd745ef90ac715a6
|
3 |
-
size 880588
|
|
|
|
|
|
|
|
voices/Олександр Ролдугін.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d3a47c7682931a5feb2e1fa76f1eac3c7f4d89a70bde20fb4d778c04a4a0a06a
|
3 |
+
size 2239
|
voices/Олена Шверк.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7b47e1f21ff2ff3452a585d575713199f51652a7986e5282d78a8b743387e3bd
|
3 |
+
size 2239
|
voices/Павло Буковський.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9add8f56848e868ff770b75015102a426dbfd5782b6a6dc7dfd94a67220414aa
|
3 |
+
size 2239
|
voices/Петро Філяк.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:02b9eae3aa5a6e25e6876b57eae80a566a9cef4243caa5a9fece0544970eb3ec
|
3 |
+
size 2239
|
voices/Поліна Еккерт(хлопчик).pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cbc715e0fbca82b6e086718fbb8321896347b7b84caea6e0a9046f3f456f7736
|
3 |
+
size 2239
|
voices/Поліна Еккерт.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:76a55eb586d9c5dbf6616a367eea5a03ae2295649187d61a63d264a28ab0717f
|
3 |
+
size 2239
|
voices/Роман Куліш.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a9e2d70d0e0efdd3ad73b07e66db251ae13de18440fffb03c049cc6433d541b3
|
3 |
+
size 2239
|
voices/Слава Красовська.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:601bca5dfe1145e009ab43f0057e8daebcee8e57897c9b049d1bdf20f4fa3a5a
|
3 |
+
size 2204
|
voices/Слава Красовська.wav
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:5648b8705b53f226c25474f48264ad88ca3b156cac9225ba8096b175b6b3a9ff
|
3 |
-
size 947788
|
|
|
|
|
|
|
|
voices/Тарас Василюк.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5ca59143b9adba1c563121ffac008b542f12918cc1d953a02b631cbf3f51714b
|
3 |
+
size 2239
|
voices/Тетяна Гончарова.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1190cfd8ac54396846d79df1d7eca80e962e84a179f310365721d5b2f041d323
|
3 |
+
size 2239
|
voices/Тетяна Лукинюк.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c0e241bf3f226ef3fae593084d6b1515517698e57625891e2ca69a99224b984b
|
3 |
+
size 2239
|
voices/Юрій Вихованець.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:595a1257c0cec43e4c8f0e11245e074dd260d31885f4332687dd42b34e2c2ca8
|
3 |
+
size 2239
|
voices/Юрій Кудрявець.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1c53c42488b474e33122cc3f61f994f64cbefdff75c552655e94af6708deb6e7
|
3 |
+
size 2204
|
voices/Юрій Кудрявець.wav
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:e7e8ec2de5c6c2dba550d9814a93796fb081d55a2eedbad2bcb864ba96b5c869
|
3 |
-
size 954988
|
|
|
|
|
|
|
|
voices/Яніна Соколова.wav
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:82387f2d814df32a9bf50ebaab3616bdd5d74e57b0466339573e94ff2f3144a3
|
3 |
-
size 906988
|
|
|
|
|
|
|
|