Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -23,12 +23,14 @@ def guessanAge(model, image):
|
|
23 |
|
24 |
def text2speech(model, text):
|
25 |
if len(text) > 0:
|
26 |
-
|
|
|
27 |
embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
|
28 |
speaker_embedding = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze(0)
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
32 |
|
33 |
radio1 = gr.Radio(["microsoft/resnet-50", "google/vit-base-patch16-224", "apple/mobilevit-small"], label="Select a Classifier", info="Image Classifier")
|
34 |
tab1 = gr.Interface(
|
|
|
23 |
|
24 |
def text2speech(model, text):
|
25 |
if len(text) > 0:
|
26 |
+
synthesiser = pipeline("text-to-speech", model=model)
|
27 |
+
|
28 |
embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
|
29 |
speaker_embedding = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze(0)
|
30 |
+
|
31 |
+
speech = synthesiser(text, forward_params={"speaker_embeddings": speaker_embedding})
|
32 |
+
print(speech, type(speech) )
|
33 |
+
return speech
|
34 |
|
35 |
radio1 = gr.Radio(["microsoft/resnet-50", "google/vit-base-patch16-224", "apple/mobilevit-small"], label="Select a Classifier", info="Image Classifier")
|
36 |
tab1 = gr.Interface(
|