AshwinSankar commited on
Commit
b0e6460
·
verified ·
1 Parent(s): eea07ad

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +2 -0
README.md CHANGED
@@ -43,6 +43,7 @@ pip install transformers torch
43
  Here's a quick example to get started:
44
 
45
  ```python
 
46
  from transformers import AutoModel, AutoTokenizer
47
 
48
  model = AutoModel.from_pretrained("ai4bharat/vits_rasa_13", trust_remote_code=True).to("cuda")
@@ -54,6 +55,7 @@ style_id = 0 # ALEXA
54
 
55
  inputs = tokenizer(text=text, return_tensors="pt").to("cuda")
56
  outputs = model(inputs['input_ids'], speaker_id=speaker_id, emotion_id=style_id)
 
57
  print(outputs.waveform.shape)
58
  ```
59
 
 
43
  Here's a quick example to get started:
44
 
45
  ```python
46
+ import soundfile as sf
47
  from transformers import AutoModel, AutoTokenizer
48
 
49
  model = AutoModel.from_pretrained("ai4bharat/vits_rasa_13", trust_remote_code=True).to("cuda")
 
55
 
56
  inputs = tokenizer(text=text, return_tensors="pt").to("cuda")
57
  outputs = model(inputs['input_ids'], speaker_id=speaker_id, emotion_id=style_id)
58
+ sf.write("audio.wav", outputs.waveform.squeeze(), model.config.sampling_rate)
59
  print(outputs.waveform.shape)
60
  ```
61