Hecheng0625
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -28,6 +28,7 @@ git https://github.com/open-mmlab/Amphion.git
|
|
28 |
Few lines of code to use the pre-trained FACodec model
|
29 |
```python
|
30 |
from Amphion.models.ns3_codec import FACodecEncoder, FACodecDecoder
|
|
|
31 |
|
32 |
fa_encoder = FACodecEncoder(
|
33 |
ngf=32,
|
@@ -53,8 +54,11 @@ fa_decoder = FACodecDecoder(
|
|
53 |
use_gr_residual_phone=True,
|
54 |
)
|
55 |
|
56 |
-
|
57 |
-
|
|
|
|
|
|
|
58 |
|
59 |
fa_encoder.eval()
|
60 |
fa_decoder.eval()
|
|
|
28 |
Few lines of code to use the pre-trained FACodec model
|
29 |
```python
|
30 |
from Amphion.models.ns3_codec import FACodecEncoder, FACodecDecoder
|
31 |
+
from huggingface_hub import hf_hub_download
|
32 |
|
33 |
fa_encoder = FACodecEncoder(
|
34 |
ngf=32,
|
|
|
54 |
use_gr_residual_phone=True,
|
55 |
)
|
56 |
|
57 |
+
encoder_ckpt = hf_hub_download(repo_id="amphion/naturalspeech3_facodec", filename="ns3_facodec_encoder.bin")
|
58 |
+
decoder_ckpt = hf_hub_download(repo_id="amphion/naturalspeech3_facodec", filename="ns3_facodec_decoder.bin")
|
59 |
+
|
60 |
+
fa_encoder.load_state_dict(torch.load(encoder_ckpt))
|
61 |
+
fa_decoder.load_state_dict(torch.load(decoder_ckpt))
|
62 |
|
63 |
fa_encoder.eval()
|
64 |
fa_decoder.eval()
|