Heinrich Dinkel
commited on
Commit
·
73556ff
1
Parent(s):
d5a213e
Updated README
Browse files
README.md
CHANGED
|
@@ -49,13 +49,13 @@ audio, sr = torchaudio.load("path/to/audio.wav")
|
|
| 49 |
# attention_mask[0, 8000:] = 0 # Example: mask second half of first sample
|
| 50 |
|
| 51 |
# Method 1: End-to-end processing (encode + decode)
|
| 52 |
-
with torch.no_grad()
|
| 53 |
outputs = model(audio) # Optionally pass attention_mask=attention_mask
|
| 54 |
reconstructed_audio = outputs["audio"]
|
| 55 |
embeddings = outputs['embeddings']
|
| 56 |
|
| 57 |
# Method 2: Separate encoding and decoding
|
| 58 |
-
with torch.no_grad()
|
| 59 |
# Encode audio to embeddings
|
| 60 |
embeddings = model.encode(audio) # Optionally pass attention_mask=attention_mask
|
| 61 |
|
|
|
|
| 49 |
# attention_mask[0, 8000:] = 0 # Example: mask second half of first sample
|
| 50 |
|
| 51 |
# Method 1: End-to-end processing (encode + decode)
|
| 52 |
+
with torch.no_grad(), torch.autocast(device_type='cuda')::
|
| 53 |
outputs = model(audio) # Optionally pass attention_mask=attention_mask
|
| 54 |
reconstructed_audio = outputs["audio"]
|
| 55 |
embeddings = outputs['embeddings']
|
| 56 |
|
| 57 |
# Method 2: Separate encoding and decoding
|
| 58 |
+
with torch.no_grad(), torch.autocast(device_type='cuda')::
|
| 59 |
# Encode audio to embeddings
|
| 60 |
embeddings = model.encode(audio) # Optionally pass attention_mask=attention_mask
|
| 61 |
|