CEHB commited on
Commit
468c094
1 Parent(s): fea56be

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -3
README.md CHANGED
@@ -27,7 +27,7 @@ It achieves the following results on the evaluation set:
27
  Swedish SpeechT5 model trained on Swedish language in Common Voice. Example on how to implement the model below (not possible to run inference at Huggingface).
28
 
29
  ```
30
- pip install datasets soundfile speechbrain
31
  pip install git+https://github.com/huggingface/transformers.git
32
 
33
  from transformers import SpeechT5Processor, SpeechT5ForTextToSpeech, SpeechT5HifiGan, set_seed
@@ -53,6 +53,7 @@ repl = [
53
 
54
  ]
55
 
 
56
  embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
57
 
58
  speaker_embeddings = torch.tensor(embeddings_dataset[7000]["xvector"]).unsqueeze(0)
@@ -65,8 +66,8 @@ inputs = processor(text=text, return_tensors="pt")
65
 
66
  speech = model.generate_speech(inputs["input_ids"], speaker_embeddings, vocoder=vocoder)
67
 
68
- from IPython.display import Audio
69
- Audio(speech.cpu().numpy(), rate=16000)
70
 
71
  ```
72
 
 
27
  Swedish SpeechT5 model trained on Swedish language in Common Voice. Example on how to implement the model below (not possible to run inference at Huggingface).
28
 
29
  ```
30
+ pip install datasets soundfile
31
  pip install git+https://github.com/huggingface/transformers.git
32
 
33
  from transformers import SpeechT5Processor, SpeechT5ForTextToSpeech, SpeechT5HifiGan, set_seed
 
53
 
54
  ]
55
 
56
+ from datasets import load_dataset
57
  embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
58
 
59
  speaker_embeddings = torch.tensor(embeddings_dataset[7000]["xvector"]).unsqueeze(0)
 
66
 
67
  speech = model.generate_speech(inputs["input_ids"], speaker_embeddings, vocoder=vocoder)
68
 
69
+ import soundfile as sf
70
+ sf.write("output.wav", speech.numpy(), samplerate=16000)
71
 
72
  ```
73