huseinzolkepliscicom commited on
Commit
9a1462e
·
verified ·
1 Parent(s): c2377e0

README: use Scicom-intl/neucodec-44k-d20 + correct _from_pretrained(decoder_depth=20) + link GitHub #load-from-hugging-face

Browse files
Files changed (1) hide show
  1. README.md +16 -7
README.md CHANGED
@@ -27,11 +27,14 @@ NeuCodec, so this model is a drop-in higher-fidelity decoder.
27
  Training pipeline, configs and RunPod automation:
28
  **https://github.com/Scicom-AI-Enterprise-Organization/neucodec-44k**
29
 
 
 
 
30
  ## Files
31
 
32
  | file | what |
33
  |---|---|
34
- | `pytorch_model.bin` | decoder weights for **inference** (load with `NeuCodec.from_pretrained`) |
35
  | `last.ckpt` | full PyTorch-Lightning checkpoint **with optimizer states + LR schedulers** for **resuming training** |
36
 
37
  ## Training data
@@ -404,17 +407,23 @@ and SR-verified ≥ 44 kHz. Original sources:
404
 
405
  ## Usage
406
 
 
 
 
 
 
407
  ```python
408
- import torch, soundfile as sf
409
  from neucodec import NeuCodec
410
 
411
- model = NeuCodec.from_pretrained("Scicom-intl/neucodec-44k-d20")
412
- model.eval().cuda()
 
413
 
414
  # encode (16 kHz path, frozen) -> codes -> decode (44.1 kHz, this finetune)
415
- codes = model.encode_code(input_waveform=wav_16k) # [B, 1, T], identical to base NeuCodec
416
- recon_44k = model.decode_code(codes).cpu().numpy()[0, 0] # 44 100 Hz
417
- sf.write("recon.wav", recon_44k, 44_100)
418
  ```
419
 
420
  The discrete codes are **identical to base `neuphonic/neucodec`** — only the reconstruction
 
27
  Training pipeline, configs and RunPod automation:
28
  **https://github.com/Scicom-AI-Enterprise-Organization/neucodec-44k**
29
 
30
+ Load instructions (canonical):
31
+ **https://github.com/Scicom-AI-Enterprise-Organization/neucodec-44k#load-from-hugging-face**
32
+
33
  ## Files
34
 
35
  | file | what |
36
  |---|---|
37
+ | `pytorch_model.bin` | decoder weights for **inference** (load with `NeuCodec._from_pretrained(..., decoder_depth=20)`) |
38
  | `last.ckpt` | full PyTorch-Lightning checkpoint **with optimizer states + LR schedulers** for **resuming training** |
39
 
40
  ## Training data
 
407
 
408
  ## Usage
409
 
410
+ See the canonical
411
+ [**Load from Hugging Face**](https://github.com/Scicom-AI-Enterprise-Organization/neucodec-44k#load-from-hugging-face)
412
+ section in the source repo. **`decoder_depth=20` is required** — the weights are a
413
+ depth-20 decoder, so loading with any other depth mismatches the architecture.
414
+
415
  ```python
416
+ import soundfile as sf
417
  from neucodec import NeuCodec
418
 
419
+ # decoder_depth=20 MUST match this repo; pass token=... (or hf login) for access
420
+ model = NeuCodec._from_pretrained(model_id="Scicom-intl/neucodec-44k-d20", decoder_depth=20)
421
+ model = model.eval().cuda()
422
 
423
  # encode (16 kHz path, frozen) -> codes -> decode (44.1 kHz, this finetune)
424
+ codes = model.encode_code("input.wav") # [1, 1, T], identical to base NeuCodec
425
+ recon_44k = model.decode_code(codes).squeeze().cpu().numpy()
426
+ sf.write("recon.wav", recon_44k, model.sample_rate) # 44100
427
  ```
428
 
429
  The discrete codes are **identical to base `neuphonic/neucodec`** — only the reconstruction