Update handler.py
Browse files- handler.py +1 -1
handler.py
CHANGED
@@ -11,7 +11,7 @@ class EndpointHandler:
|
|
11 |
self.api = InferenceApi(repo_id="microsoft/speecht5_tts", task="text-to-speech")
|
12 |
self.embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
|
13 |
|
14 |
-
def __call__(self, data
|
15 |
text = data.get("inputs", "")
|
16 |
# Extract speaker_embedding using the index from your dataset, or replace with your own logic.
|
17 |
speaker_embedding = torch.tensor(self.embeddings_dataset[7306]["xvector"]).unsqueeze(0)
|
|
|
11 |
self.api = InferenceApi(repo_id="microsoft/speecht5_tts", task="text-to-speech")
|
12 |
self.embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
|
13 |
|
14 |
+
def __call__(self, data):
|
15 |
text = data.get("inputs", "")
|
16 |
# Extract speaker_embedding using the index from your dataset, or replace with your own logic.
|
17 |
speaker_embedding = torch.tensor(self.embeddings_dataset[7306]["xvector"]).unsqueeze(0)
|