patrickvonplaten
commited on
Commit
·
2fd6ccd
1
Parent(s):
426e0f2
Update README.md
Browse files
README.md
CHANGED
@@ -56,11 +56,12 @@ processor = MCTCTProcessor.from_pretrained("speechbrain/mctct-large")
|
|
56 |
# load dummy dataset and read soundfiles
|
57 |
ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation")
|
58 |
|
59 |
-
#
|
60 |
-
input_features = processor(ds[0]["audio"]["array"], return_tensors="pt").input_features
|
61 |
|
62 |
# retrieve logits
|
63 |
-
|
|
|
64 |
|
65 |
# take argmax and decode
|
66 |
predicted_ids = torch.argmax(logits, dim=-1)
|
|
|
56 |
# load dummy dataset and read soundfiles
|
57 |
ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation")
|
58 |
|
59 |
+
# feature extraction
|
60 |
+
input_features = processor(ds[0]["audio"]["array"], sampling_rate=ds[0]["audio"]["sampling_rate"], return_tensors="pt").input_features
|
61 |
|
62 |
# retrieve logits
|
63 |
+
with torch.no_grad():
|
64 |
+
logits = model(input_features).logits
|
65 |
|
66 |
# take argmax and decode
|
67 |
predicted_ids = torch.argmax(logits, dim=-1)
|