hans00 commited on
Commit
9fcacec
·
verified ·
1 Parent(s): 0b704d8

README: explain the llama.cpp + codec.cpp split; llama.rn usage

Browse files
Files changed (1) hide show
  1. README.md +17 -1
README.md CHANGED
@@ -33,9 +33,25 @@ hf download BricksDisplay/codec.cpp-gguf ibm-research--DAC.speech.gguf --local-d
33
  ./build/codec-cli decode --model codecs/ibm-research--DAC.speech.gguf --codes codes.npy --out decoded.wav
34
  ```
35
 
36
- Build instructions, GPU flags and the Python API are in the
 
 
 
 
 
 
 
 
 
 
 
 
37
  [codec.cpp README](https://github.com/mybigday/codec.cpp).
38
 
 
 
 
 
39
  ## License
40
 
41
  Each codec keeps its original license: DAC.speech CDLA-Permissive-2.0, NeMo Nano Codec the NVIDIA Open Model License, WavTokenizer MIT.
 
33
  ./build/codec-cli decode --model codecs/ibm-research--DAC.speech.gguf --codes codes.npy --out decoded.wav
34
  ```
35
 
36
+ Python (`pip install .` in a codec.cpp checkout; see
37
+ [python/README.md](https://github.com/mybigday/codec.cpp/blob/main/python/README.md)):
38
+
39
+ ```python
40
+ import codec_cpp, soundfile as sf
41
+
42
+ ctx = codec_cpp.Model("codecs/ibm-research--DAC.speech.gguf").context()
43
+ pcm, sr = sf.read("speech.wav", dtype="float32")
44
+ codes = ctx.encode(pcm, sr) # int32 (n_frames, n_q)
45
+ audio, sr = ctx.decode(codes)
46
+ ```
47
+
48
+ Build instructions and GPU flags are in the
49
  [codec.cpp README](https://github.com/mybigday/codec.cpp).
50
 
51
+ These codecs are also the audio side of TTS models: there a llama.cpp LM
52
+ backbone writes the codes and codec.cpp turns them into audio (see the
53
+ `*-GGUF` TTS repos of this organization).
54
+
55
  ## License
56
 
57
  Each codec keeps its original license: DAC.speech CDLA-Permissive-2.0, NeMo Nano Codec the NVIDIA Open Model License, WavTokenizer MIT.