Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,7 @@ dataset = load_dataset("mskov/miso_test", split="test").cast_column("audio", Aud
|
|
23 |
|
24 |
print(dataset, "and at 0[audio][array] ", dataset[0]["audio"]["array"], type(dataset[0]["audio"]["array"]), "and at audio : ", dataset[0]["audio"])
|
25 |
|
26 |
-
model = WhisperForConditionalGeneration.from_pretrained("mskov/whisper-small-esc50")
|
27 |
|
28 |
# Evaluate the model
|
29 |
# model.eval()
|
@@ -35,7 +35,7 @@ def map_to_pred(batch):
|
|
35 |
|
36 |
|
37 |
with torch.no_grad():
|
38 |
-
predicted_ids = model.generate(input_features
|
39 |
|
40 |
transcription = processor.decode(predicted_ids)
|
41 |
batch["prediction"] = processor.tokenizer._normalize(transcription)
|
|
|
23 |
|
24 |
print(dataset, "and at 0[audio][array] ", dataset[0]["audio"]["array"], type(dataset[0]["audio"]["array"]), "and at audio : ", dataset[0]["audio"])
|
25 |
|
26 |
+
model = WhisperForConditionalGeneration.from_pretrained("mskov/whisper-small-esc50")
|
27 |
|
28 |
# Evaluate the model
|
29 |
# model.eval()
|
|
|
35 |
|
36 |
|
37 |
with torch.no_grad():
|
38 |
+
predicted_ids = model.generate(input_features)[0]
|
39 |
|
40 |
transcription = processor.decode(predicted_ids)
|
41 |
batch["prediction"] = processor.tokenizer._normalize(transcription)
|