Sandiago21 commited on
Commit
218c550
1 Parent(s): 5d24988

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -3,15 +3,15 @@ import torch
3
  from datasets import load_dataset
4
  from transformers import pipeline, SpeechT5Processor, SpeechT5HifiGan, SpeechT5ForTextToSpeech
5
 
6
- model_id = "Sandiago21/speecht5_finetuned_voxpopuli_it" # update with your model id
7
  # pipe = pipeline("automatic-speech-recognition", model=model_id)
8
  model = SpeechT5ForTextToSpeech.from_pretrained(model_id)
9
  vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan")
10
  embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
11
  speaker_embeddings = torch.tensor(embeddings_dataset[7440]["xvector"]).unsqueeze(0)
12
 
13
- checkpoint = "microsoft/speecht5_tts"
14
- processor = SpeechT5Processor.from_pretrained(checkpoint)
15
 
16
  replacements = [
17
  ("ου", "u"),
@@ -89,8 +89,13 @@ replacements = [
89
  ("ό", "o"),
90
  ("ύ", "i"),
91
  ("ώ", "o"),
 
 
 
 
92
  ]
93
 
 
94
  def cleanup_text(text):
95
  for src, dst in replacements:
96
  text = text.replace(src, dst)
 
3
  from datasets import load_dataset
4
  from transformers import pipeline, SpeechT5Processor, SpeechT5HifiGan, SpeechT5ForTextToSpeech
5
 
6
+ model_id = "Sandiago21/speecht5_finetuned_google_fleurs_greek" # update with your model id
7
  # pipe = pipeline("automatic-speech-recognition", model=model_id)
8
  model = SpeechT5ForTextToSpeech.from_pretrained(model_id)
9
  vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan")
10
  embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
11
  speaker_embeddings = torch.tensor(embeddings_dataset[7440]["xvector"]).unsqueeze(0)
12
 
13
+ # checkpoint = "microsoft/speecht5_tts"
14
+ processor = SpeechT5Processor.from_pretrained(model_id)
15
 
16
  replacements = [
17
  ("ου", "u"),
 
89
  ("ό", "o"),
90
  ("ύ", "i"),
91
  ("ώ", "o"),
92
+ ("í", "i"),
93
+ ("õ", "o"),
94
+ ("Ε", "E"),
95
+ ("Ψ", "Ps"),
96
  ]
97
 
98
+
99
  def cleanup_text(text):
100
  for src, dst in replacements:
101
  text = text.replace(src, dst)