Spaces:
Running
Running
Commit
·
25106b9
1
Parent(s):
547836e
small bug fix
Browse files- ASR_Server.py +5 -5
ASR_Server.py
CHANGED
@@ -32,10 +32,10 @@ csv_result = f"test_with_{ASR_model.replace("/","_")}_WER.csv"
|
|
32 |
df = pd.read_csv(csv_path)
|
33 |
print(f"CSV Loaded with {len(df)} rows")
|
34 |
|
35 |
-
#
|
36 |
-
|
37 |
-
#
|
38 |
-
|
39 |
|
40 |
def generateTranscript(ASR_model):
|
41 |
import os
|
@@ -81,7 +81,7 @@ def generateTranscript(ASR_model):
|
|
81 |
# dataset = dataset.with_format("python", decode_audio=False)
|
82 |
dataset_map = {
|
83 |
os.path.basename(sample["audio"]["path"]).lower(): sample
|
84 |
-
|
85 |
}
|
86 |
|
87 |
transcripts = []
|
|
|
32 |
df = pd.read_csv(csv_path)
|
33 |
print(f"CSV Loaded with {len(df)} rows")
|
34 |
|
35 |
+
# Load dataset without decoding audio (required!)
|
36 |
+
dataset = load_dataset("satyamr196/asr_fairness_audio", split="train")
|
37 |
+
# dataset = dataset.with_format("python", decode_audio=False)
|
38 |
+
dataset = dataset.cast_column("audio", Audio(decode=False))
|
39 |
|
40 |
def generateTranscript(ASR_model):
|
41 |
import os
|
|
|
81 |
# dataset = dataset.with_format("python", decode_audio=False)
|
82 |
dataset_map = {
|
83 |
os.path.basename(sample["audio"]["path"]).lower(): sample
|
84 |
+
for sample in dataset #uncomment this line to use the dataset
|
85 |
}
|
86 |
|
87 |
transcripts = []
|