Spaces:
Runtime error
Runtime error
Update app.py
Browse files2 unmodified lines3456789101112131415161712 unmodified lines3031323334353616 unmodified lines5354555657585960612 unmodified linesfrom datasets import load_datasetfrom transformers import pipeline, SpeechT5Processor, SpeechT5HifiGan, SpeechT5ForTextToSpeechmodel_id = "gitgato/tr-xtts" # update with your model id# pipe = pipeline("automatic-speech-recognition", model=model_id)model = SpeechT5ForTextToSpeech.from_pretrained(model_id)vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan")embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")speaker_embeddings = torch.tensor(embeddings_dataset[7440]["xvector"]).unsqueeze(0)# checkpoint = "microsoft/speecht5_tts"processor = SpeechT5Processor.from_pretrained(model_id)replacements = [("à", "a"),12 unmodified linestitle = "Text-to-Speech"description = """Demo for text-to-speech translation in French. Demo uses [Sandiago21/speecht5_finetuned_facebook_voxpopuli_french](https://huggingface.co/Sandiago21/speecht5_finetuned_facebook_voxpopuli_french) checkpoint, which is based on Microsoft's[SpeechT5 TTS](https://huggingface.co/microsoft/speecht5_tts) model and is fine-tuned in French Audio dataset")"""16 unmodified linessynthesize_speech,inputs = gr.Textbox(label="Text", placeholder="Type something here..."),outputs=gr.Audio(),examples=["Hola, probando audio."],title=title,description=description,).launch()2 unmodified lines3456789101112131415161712 unmodified lines3031323334353616 unmodified lines535455565758592 unmodified linesfrom datasets import load_datasetfrom transformers import pipeline, SpeechT5Processor, SpeechT5HifiGan, SpeechT5ForTextToSpeechmodel_id = "gitgato/tr-tts" # update with your model idpipe = pipeline("text-to-speech", model="gitgato/tr-xtts")model = SpeechT5ForTextToSpeech.from_pretrained(model_id)vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan")embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")speaker_embeddings = torch.tensor(embeddings_dataset[7440]["xvector"]).unsqueeze(0)# checkpoint = "microsoft/speecht5_tts"processor = AutoProcessor.from_pretrained("gitgato/tr-xtts")replacements = [("à", "a"),12 unmodified linestitle = "Text-to-Speech"description = """Demo for text-to-speech translation in French. Demo uses [gitgato/trtts](https://huggingface.co) checkpoint, which is based on Microsoft's[SpeechT5 TTS](https://huggingface.co/microsoft/speecht5_tts) model and is fine-tuned in French Audio dataset")"""16 unmodified linessynthesize_speech,inputs = gr.Textbox(label="Text", placeholder="Type something here..."),outputs=gr.Audio(),examples=["Je n'entrerai pas dans les détails, mais je profiterai des secondes qui me restent pour exposer la position ALDE sur le marquage CE, un des points cruciaux de ce rapport."],title=title,description=description,).launch()
app.py+6-8