sw005320 tiansz commited on
Commit
cfb6786
1 Parent(s): 7695e75

Update README.md (#1)

Browse files

- Update README.md (3fdd45c77e8ba57559eaa8b39fddd20ae5503998)


Co-authored-by: 张少添 <tiansz@users.noreply.huggingface.co>

Files changed (1) hide show
  1. README.md +13 -1
README.md CHANGED
@@ -14,8 +14,20 @@ license: cc-by-4.0
14
 
15
  This model was trained by kan-bayashi using csmsc/tts1 recipe in [espnet](https://github.com/espnet/espnet/).
16
  ### Demo: How to use in ESPnet2
 
 
 
 
 
 
17
  ```python
18
- # coming soon
 
 
 
 
 
 
19
  ```
20
  ### Citing ESPnet
21
  ```BibTex
 
14
 
15
  This model was trained by kan-bayashi using csmsc/tts1 recipe in [espnet](https://github.com/espnet/espnet/).
16
  ### Demo: How to use in ESPnet2
17
+ You first need to import the following packages
18
+ ```bash
19
+ pip install torch
20
+ pip install espnet_model_zoo
21
+ ```
22
+ Then start using it!
23
  ```python
24
+ import soundfile
25
+ from espnet2.bin.tts_inference import Text2Speech
26
+ text2speech = Text2Speech.from_pretrained("espnet/kan-bayashi_csmsc_tts_train_tacotron2_raw_phn_pypinyin_g2p_phone_train.loss.best")
27
+
28
+ text = "春江潮水连海平,海上明月共潮生"
29
+ speech = text2speech(text)["wav"]
30
+ soundfile.write("out.wav", speech.numpy(), text2speech.fs, "PCM_16")
31
  ```
32
  ### Citing ESPnet
33
  ```BibTex