Spaces:
Running
on
Zero
Running
on
Zero
Serhiy Stetskovych
commited on
Commit
·
2d19e29
1
Parent(s):
23c8216
Add spaces decorator
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ import os
|
|
3 |
import re
|
4 |
import gradio as gr
|
5 |
import onnxruntime
|
|
|
6 |
from transformers import AutoTokenizer
|
7 |
from huggingface_hub import hf_hub_download
|
8 |
import numpy as np
|
@@ -144,6 +145,8 @@ def generate_text(text):
|
|
144 |
output_text = tokenizer.decode(decoder_input_ids[0], skip_special_tokens=True)
|
145 |
return output_text
|
146 |
|
|
|
|
|
147 |
def verbalize(text):
|
148 |
parts = split_to_parts(text)
|
149 |
verbalized = ''
|
@@ -169,6 +172,7 @@ examples = [
|
|
169 |
|
170 |
|
171 |
|
|
|
172 |
def synthesize(model_name, text, speed, voice_audio = None, progress=gr.Progress()):
|
173 |
|
174 |
if text.strip() == "":
|
|
|
3 |
import re
|
4 |
import gradio as gr
|
5 |
import onnxruntime
|
6 |
+
import spaces
|
7 |
from transformers import AutoTokenizer
|
8 |
from huggingface_hub import hf_hub_download
|
9 |
import numpy as np
|
|
|
145 |
output_text = tokenizer.decode(decoder_input_ids[0], skip_special_tokens=True)
|
146 |
return output_text
|
147 |
|
148 |
+
|
149 |
+
@spaces.GPU
|
150 |
def verbalize(text):
|
151 |
parts = split_to_parts(text)
|
152 |
verbalized = ''
|
|
|
172 |
|
173 |
|
174 |
|
175 |
+
@spaces.GPU
|
176 |
def synthesize(model_name, text, speed, voice_audio = None, progress=gr.Progress()):
|
177 |
|
178 |
if text.strip() == "":
|