Update README.md
Browse files
README.md
CHANGED
|
@@ -65,13 +65,13 @@ audio, sr = torchaudio.load("path/to/audio.wav")
|
|
| 65 |
# attention_mask[0, 8000:] = 0 # Example: mask second half of first sample
|
| 66 |
|
| 67 |
# Method 1: End-to-end processing (encode + decode)
|
| 68 |
-
with torch.no_grad(), torch.autocast(device_type='cuda'):
|
| 69 |
outputs = model(audio) # Optionally pass attention_mask=attention_mask
|
| 70 |
reconstructed_audio = outputs["audio"]
|
| 71 |
embeddings = outputs['embeddings']
|
| 72 |
|
| 73 |
# Method 2: Separate encoding and decoding
|
| 74 |
-
with torch.no_grad(), torch.autocast(device_type='cuda'):
|
| 75 |
# Encode audio to embeddings
|
| 76 |
embeddings = model.encode(audio) # Optionally pass attention_mask=attention_mask
|
| 77 |
|
|
|
|
| 65 |
# attention_mask[0, 8000:] = 0 # Example: mask second half of first sample
|
| 66 |
|
| 67 |
# Method 1: End-to-end processing (encode + decode)
|
| 68 |
+
with torch.no_grad(), torch.autocast(device_type='cuda'):
|
| 69 |
outputs = model(audio) # Optionally pass attention_mask=attention_mask
|
| 70 |
reconstructed_audio = outputs["audio"]
|
| 71 |
embeddings = outputs['embeddings']
|
| 72 |
|
| 73 |
# Method 2: Separate encoding and decoding
|
| 74 |
+
with torch.no_grad(), torch.autocast(device_type='cuda'):
|
| 75 |
# Encode audio to embeddings
|
| 76 |
embeddings = model.encode(audio) # Optionally pass attention_mask=attention_mask
|
| 77 |
|