ALWOAL commited on
Commit
72a8032
·
verified ·
1 Parent(s): c7208c6

Focal native twin: fresh instance build instead of CUDA deepcopy

Browse files
Files changed (41) hide show
  1. app.py +5 -2
  2. lscodec/distributed/__pycache__/__init__.cpython-314.pyc +0 -0
  3. lscodec/distributed/__pycache__/distrib.cpython-314.pyc +0 -0
  4. lscodec/layers/__pycache__/__init__.cpython-314.pyc +0 -0
  5. lscodec/layers/__pycache__/causal_conv.cpython-314.pyc +0 -0
  6. lscodec/layers/__pycache__/pqmf.cpython-314.pyc +0 -0
  7. lscodec/layers/__pycache__/residual_block.cpython-314.pyc +0 -0
  8. lscodec/layers/__pycache__/residual_stack.cpython-314.pyc +0 -0
  9. lscodec/layers/__pycache__/tade_res_block.cpython-314.pyc +0 -0
  10. lscodec/layers/__pycache__/upsample.cpython-314.pyc +0 -0
  11. lscodec/models/__pycache__/__init__.cpython-314.pyc +0 -0
  12. lscodec/models/__pycache__/ctx_v2w.cpython-314.pyc +0 -0
  13. lscodec/models/__pycache__/feature_extractor.cpython-314.pyc +0 -0
  14. lscodec/models/__pycache__/hifigan.cpython-314.pyc +0 -0
  15. lscodec/models/__pycache__/lscodec.cpython-314.pyc +0 -0
  16. lscodec/models/__pycache__/melgan.cpython-314.pyc +0 -0
  17. lscodec/models/__pycache__/prompt_prenet.cpython-314.pyc +0 -0
  18. lscodec/models/conformer/__pycache__/__init__.cpython-314.pyc +0 -0
  19. lscodec/models/conformer/__pycache__/attention.cpython-314.pyc +0 -0
  20. lscodec/models/conformer/__pycache__/convolution.cpython-314.pyc +0 -0
  21. lscodec/models/conformer/__pycache__/decoder.cpython-314.pyc +0 -0
  22. lscodec/models/conformer/__pycache__/decoder_layer.cpython-314.pyc +0 -0
  23. lscodec/models/conformer/__pycache__/embedding.cpython-314.pyc +0 -0
  24. lscodec/models/conformer/__pycache__/layer_norm.cpython-314.pyc +0 -0
  25. lscodec/models/conformer/__pycache__/multi_layer_conv.cpython-314.pyc +0 -0
  26. lscodec/models/conformer/__pycache__/nets_utils.cpython-314.pyc +0 -0
  27. lscodec/models/conformer/__pycache__/positionwise_feed_forward.cpython-314.pyc +0 -0
  28. lscodec/models/conformer/__pycache__/repeat.cpython-314.pyc +0 -0
  29. lscodec/models/conformer/__pycache__/subsampling.cpython-314.pyc +0 -0
  30. lscodec/models/conformer/__pycache__/swish.cpython-314.pyc +0 -0
  31. lscodec/models/conformer/__pycache__/vgg2l.cpython-314.pyc +0 -0
  32. lscodec/models/fairseq_modules/__pycache__/__init__.cpython-314.pyc +0 -0
  33. lscodec/models/fairseq_modules/__pycache__/fp32_group_norm.cpython-314.pyc +0 -0
  34. lscodec/models/fairseq_modules/__pycache__/gumbel_vector_quantizer.cpython-314.pyc +0 -0
  35. lscodec/models/fairseq_modules/__pycache__/layer_norm.cpython-314.pyc +0 -0
  36. lscodec/models/fairseq_modules/__pycache__/transpose_last.cpython-314.pyc +0 -0
  37. lscodec/models/quantization/__pycache__/__init__.cpython-314.pyc +0 -0
  38. lscodec/models/quantization/__pycache__/core_vq.cpython-314.pyc +0 -0
  39. lscodec/models/quantization/__pycache__/vq.cpython-314.pyc +0 -0
  40. lscodec/utils/__pycache__/__init__.cpython-314.pyc +0 -0
  41. lscodec/utils/__pycache__/utils.cpython-314.pyc +0 -0
app.py CHANGED
@@ -1,6 +1,5 @@
1
  """FocalCodec 12.5 Hz weight-quantization lab (Gradio / ZeroGPU)."""
2
 
3
- import copy
4
  import hashlib
5
  import time
6
 
@@ -36,7 +35,11 @@ BASE_STATE = {k: v.detach().cpu().clone() for k, v in codec.state_dict().items()
36
  SIZES = {level: core.model_size_mb(BASE_STATE, level) for level in QUANT_LEVELS}
37
  NATIVE_LEVEL = "int8-native"
38
  try:
39
- codec_i8 = int8nn.apply_int8(copy.deepcopy(codec), BASE_STATE) # W8A8 twin: int8-resident weights
 
 
 
 
40
  except Exception as exc: # noqa: BLE001 a runtime quirk must not take the demo down
41
  codec_i8 = None
42
  print(f"[int8] native FocalCodec disabled: {exc!r}")
 
1
  """FocalCodec 12.5 Hz weight-quantization lab (Gradio / ZeroGPU)."""
2
 
 
3
  import hashlib
4
  import time
5
 
 
35
  SIZES = {level: core.model_size_mb(BASE_STATE, level) for level in QUANT_LEVELS}
36
  NATIVE_LEVEL = "int8-native"
37
  try:
38
+ # fresh instance, not deepcopy: a second copy of the live (CUDA) codec is not deep-copyable there
39
+ codec_i8 = int8nn.apply_int8(
40
+ torch.hub.load(HUB_REPO, "focalcodec", config=MODEL_REPO, trust_repo=True).eval().requires_grad_(False).cuda(),
41
+ BASE_STATE,
42
+ )
43
  except Exception as exc: # noqa: BLE001 a runtime quirk must not take the demo down
44
  codec_i8 = None
45
  print(f"[int8] native FocalCodec disabled: {exc!r}")
lscodec/distributed/__pycache__/__init__.cpython-314.pyc ADDED
Binary file (218 Bytes). View file
 
lscodec/distributed/__pycache__/distrib.cpython-314.pyc ADDED
Binary file (7.36 kB). View file
 
lscodec/layers/__pycache__/__init__.cpython-314.pyc ADDED
Binary file (375 Bytes). View file
 
lscodec/layers/__pycache__/causal_conv.cpython-314.pyc ADDED
Binary file (3.04 kB). View file
 
lscodec/layers/__pycache__/pqmf.cpython-314.pyc ADDED
Binary file (6.81 kB). View file
 
lscodec/layers/__pycache__/residual_block.cpython-314.pyc ADDED
Binary file (9.09 kB). View file
 
lscodec/layers/__pycache__/residual_stack.cpython-314.pyc ADDED
Binary file (3.61 kB). View file
 
lscodec/layers/__pycache__/tade_res_block.cpython-314.pyc ADDED
Binary file (5.78 kB). View file
 
lscodec/layers/__pycache__/upsample.cpython-314.pyc ADDED
Binary file (8.09 kB). View file
 
lscodec/models/__pycache__/__init__.cpython-314.pyc ADDED
Binary file (285 Bytes). View file
 
lscodec/models/__pycache__/ctx_v2w.cpython-314.pyc ADDED
Binary file (5.87 kB). View file
 
lscodec/models/__pycache__/feature_extractor.cpython-314.pyc ADDED
Binary file (8.66 kB). View file
 
lscodec/models/__pycache__/hifigan.cpython-314.pyc ADDED
Binary file (29.2 kB). View file
 
lscodec/models/__pycache__/lscodec.cpython-314.pyc ADDED
Binary file (7.35 kB). View file
 
lscodec/models/__pycache__/melgan.cpython-314.pyc ADDED
Binary file (20.3 kB). View file
 
lscodec/models/__pycache__/prompt_prenet.cpython-314.pyc ADDED
Binary file (4.21 kB). View file
 
lscodec/models/conformer/__pycache__/__init__.cpython-314.pyc ADDED
Binary file (261 Bytes). View file
 
lscodec/models/conformer/__pycache__/attention.cpython-314.pyc ADDED
Binary file (15.4 kB). View file
 
lscodec/models/conformer/__pycache__/convolution.cpython-314.pyc ADDED
Binary file (2.67 kB). View file
 
lscodec/models/conformer/__pycache__/decoder.cpython-314.pyc ADDED
Binary file (8.88 kB). View file
 
lscodec/models/conformer/__pycache__/decoder_layer.cpython-314.pyc ADDED
Binary file (7.17 kB). View file
 
lscodec/models/conformer/__pycache__/embedding.cpython-314.pyc ADDED
Binary file (12.9 kB). View file
 
lscodec/models/conformer/__pycache__/layer_norm.cpython-314.pyc ADDED
Binary file (1.67 kB). View file
 
lscodec/models/conformer/__pycache__/multi_layer_conv.cpython-314.pyc ADDED
Binary file (4.34 kB). View file
 
lscodec/models/conformer/__pycache__/nets_utils.cpython-314.pyc ADDED
Binary file (20.5 kB). View file
 
lscodec/models/conformer/__pycache__/positionwise_feed_forward.cpython-314.pyc ADDED
Binary file (1.98 kB). View file
 
lscodec/models/conformer/__pycache__/repeat.cpython-314.pyc ADDED
Binary file (1.32 kB). View file
 
lscodec/models/conformer/__pycache__/subsampling.cpython-314.pyc ADDED
Binary file (12.2 kB). View file
 
lscodec/models/conformer/__pycache__/swish.cpython-314.pyc ADDED
Binary file (911 Bytes). View file
 
lscodec/models/conformer/__pycache__/vgg2l.cpython-314.pyc ADDED
Binary file (5.19 kB). View file
 
lscodec/models/fairseq_modules/__pycache__/__init__.cpython-314.pyc ADDED
Binary file (229 Bytes). View file
 
lscodec/models/fairseq_modules/__pycache__/fp32_group_norm.cpython-314.pyc ADDED
Binary file (4.4 kB). View file
 
lscodec/models/fairseq_modules/__pycache__/gumbel_vector_quantizer.cpython-314.pyc ADDED
Binary file (11.5 kB). View file
 
lscodec/models/fairseq_modules/__pycache__/layer_norm.cpython-314.pyc ADDED
Binary file (3.22 kB). View file
 
lscodec/models/fairseq_modules/__pycache__/transpose_last.cpython-314.pyc ADDED
Binary file (1.27 kB). View file
 
lscodec/models/quantization/__pycache__/__init__.cpython-314.pyc ADDED
Binary file (339 Bytes). View file
 
lscodec/models/quantization/__pycache__/core_vq.cpython-314.pyc ADDED
Binary file (24 kB). View file
 
lscodec/models/quantization/__pycache__/vq.cpython-314.pyc ADDED
Binary file (7.64 kB). View file
 
lscodec/utils/__pycache__/__init__.cpython-314.pyc ADDED
Binary file (239 Bytes). View file
 
lscodec/utils/__pycache__/utils.cpython-314.pyc ADDED
Binary file (19.7 kB). View file