Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ from snac import SNAC
|
|
| 12 |
# -----------------------------
|
| 13 |
MODEL_NAME = "rahul7star/nava1.0"
|
| 14 |
LORA_NAME = "rahul7star/nava-audio"
|
| 15 |
-
SEQ_LEN =
|
| 16 |
TARGET_SR = 24000
|
| 17 |
OUT_ROOT = Path("/tmp/data")
|
| 18 |
OUT_ROOT.mkdir(parents=True, exist_ok=True)
|
|
@@ -92,7 +92,7 @@ def generate_audio_cpu_lora(text: str):
|
|
| 92 |
l3.extend([(slots[2]-128266)%4096, (slots[3]-128266)%4096, (slots[5]-128266)%4096, (slots[6]-128266)%4096])
|
| 93 |
|
| 94 |
|
| 95 |
-
snac_model = SNAC.from_pretrained("
|
| 96 |
codes_tensor = [torch.tensor(level, dtype=torch.long, device=DEVICE_CPU).unsqueeze(0) for level in [l1,l2,l3]]
|
| 97 |
with torch.inference_mode():
|
| 98 |
z_q = snac_model.quantizer.from_codes(codes_tensor)
|
|
|
|
| 12 |
# -----------------------------
|
| 13 |
MODEL_NAME = "rahul7star/nava1.0"
|
| 14 |
LORA_NAME = "rahul7star/nava-audio"
|
| 15 |
+
SEQ_LEN = 24000
|
| 16 |
TARGET_SR = 24000
|
| 17 |
OUT_ROOT = Path("/tmp/data")
|
| 18 |
OUT_ROOT.mkdir(parents=True, exist_ok=True)
|
|
|
|
| 92 |
l3.extend([(slots[2]-128266)%4096, (slots[3]-128266)%4096, (slots[5]-128266)%4096, (slots[6]-128266)%4096])
|
| 93 |
|
| 94 |
|
| 95 |
+
snac_model = SNAC.from_pretrained("rahul7star/nava-snac").eval().to(DEVICE_CPU)
|
| 96 |
codes_tensor = [torch.tensor(level, dtype=torch.long, device=DEVICE_CPU).unsqueeze(0) for level in [l1,l2,l3]]
|
| 97 |
with torch.inference_mode():
|
| 98 |
z_q = snac_model.quantizer.from_codes(codes_tensor)
|