Update to personal repos
Browse files- handler.py +10 -4
handler.py
CHANGED
@@ -11,12 +11,18 @@ from typing import Dict, List, Any
|
|
11 |
class EndpointHandler:
|
12 |
def __init__(self, path=""):
|
13 |
|
14 |
-
checkpoint = "microsoft/speecht5_tts"
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
self.model= SpeechT5ForTextToSpeech.from_pretrained(checkpoint)
|
17 |
self.processor = SpeechT5Processor.from_pretrained(checkpoint)
|
18 |
-
self.vocoder = SpeechT5HifiGan.from_pretrained(
|
19 |
-
self.embeddings_dataset = load_dataset(
|
20 |
|
21 |
|
22 |
def __call__(self, data: Dict[str, Any]) -> Dict[str, Any]:
|
|
|
11 |
class EndpointHandler:
|
12 |
def __init__(self, path=""):
|
13 |
|
14 |
+
#checkpoint = "microsoft/speecht5_tts"
|
15 |
+
#vocoder_id = "microsoft/speecht5_hifigan"
|
16 |
+
#dataset_id = "Matthijs/cmu-arctic-xvectors"
|
17 |
+
|
18 |
+
checkpoint = "Dupaja/speecht5_tts"
|
19 |
+
vocoder_id = "microsoft/speecht5_hifigan"
|
20 |
+
dataset_id = "Dupaja/cmu-arctic-xvectors"
|
21 |
+
|
22 |
self.model= SpeechT5ForTextToSpeech.from_pretrained(checkpoint)
|
23 |
self.processor = SpeechT5Processor.from_pretrained(checkpoint)
|
24 |
+
self.vocoder = SpeechT5HifiGan.from_pretrained(vocoder_id)
|
25 |
+
self.embeddings_dataset = load_dataset(dataset_id, split="validation")
|
26 |
|
27 |
|
28 |
def __call__(self, data: Dict[str, Any]) -> Dict[str, Any]:
|