Spaces:
Running on Zero
Running on Zero
Focal native twin: fresh instance build instead of CUDA deepcopy
Browse files- app.py +5 -2
- lscodec/distributed/__pycache__/__init__.cpython-314.pyc +0 -0
- lscodec/distributed/__pycache__/distrib.cpython-314.pyc +0 -0
- lscodec/layers/__pycache__/__init__.cpython-314.pyc +0 -0
- lscodec/layers/__pycache__/causal_conv.cpython-314.pyc +0 -0
- lscodec/layers/__pycache__/pqmf.cpython-314.pyc +0 -0
- lscodec/layers/__pycache__/residual_block.cpython-314.pyc +0 -0
- lscodec/layers/__pycache__/residual_stack.cpython-314.pyc +0 -0
- lscodec/layers/__pycache__/tade_res_block.cpython-314.pyc +0 -0
- lscodec/layers/__pycache__/upsample.cpython-314.pyc +0 -0
- lscodec/models/__pycache__/__init__.cpython-314.pyc +0 -0
- lscodec/models/__pycache__/ctx_v2w.cpython-314.pyc +0 -0
- lscodec/models/__pycache__/feature_extractor.cpython-314.pyc +0 -0
- lscodec/models/__pycache__/hifigan.cpython-314.pyc +0 -0
- lscodec/models/__pycache__/lscodec.cpython-314.pyc +0 -0
- lscodec/models/__pycache__/melgan.cpython-314.pyc +0 -0
- lscodec/models/__pycache__/prompt_prenet.cpython-314.pyc +0 -0
- lscodec/models/conformer/__pycache__/__init__.cpython-314.pyc +0 -0
- lscodec/models/conformer/__pycache__/attention.cpython-314.pyc +0 -0
- lscodec/models/conformer/__pycache__/convolution.cpython-314.pyc +0 -0
- lscodec/models/conformer/__pycache__/decoder.cpython-314.pyc +0 -0
- lscodec/models/conformer/__pycache__/decoder_layer.cpython-314.pyc +0 -0
- lscodec/models/conformer/__pycache__/embedding.cpython-314.pyc +0 -0
- lscodec/models/conformer/__pycache__/layer_norm.cpython-314.pyc +0 -0
- lscodec/models/conformer/__pycache__/multi_layer_conv.cpython-314.pyc +0 -0
- lscodec/models/conformer/__pycache__/nets_utils.cpython-314.pyc +0 -0
- lscodec/models/conformer/__pycache__/positionwise_feed_forward.cpython-314.pyc +0 -0
- lscodec/models/conformer/__pycache__/repeat.cpython-314.pyc +0 -0
- lscodec/models/conformer/__pycache__/subsampling.cpython-314.pyc +0 -0
- lscodec/models/conformer/__pycache__/swish.cpython-314.pyc +0 -0
- lscodec/models/conformer/__pycache__/vgg2l.cpython-314.pyc +0 -0
- lscodec/models/fairseq_modules/__pycache__/__init__.cpython-314.pyc +0 -0
- lscodec/models/fairseq_modules/__pycache__/fp32_group_norm.cpython-314.pyc +0 -0
- lscodec/models/fairseq_modules/__pycache__/gumbel_vector_quantizer.cpython-314.pyc +0 -0
- lscodec/models/fairseq_modules/__pycache__/layer_norm.cpython-314.pyc +0 -0
- lscodec/models/fairseq_modules/__pycache__/transpose_last.cpython-314.pyc +0 -0
- lscodec/models/quantization/__pycache__/__init__.cpython-314.pyc +0 -0
- lscodec/models/quantization/__pycache__/core_vq.cpython-314.pyc +0 -0
- lscodec/models/quantization/__pycache__/vq.cpython-314.pyc +0 -0
- lscodec/utils/__pycache__/__init__.cpython-314.pyc +0 -0
- 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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|
|
|