Spaces:
Sleeping
Sleeping
Nash-pAnDiTa
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -32,13 +32,14 @@ def update_transcriptions(df, dataset, token,dataset_link):
|
|
32 |
|
33 |
# Replace the original transcription column in the dataset
|
34 |
dataset = dataset.map(
|
35 |
-
lambda examples, idx: {"transcription": updated_dataset["transcription"][idx]}
|
36 |
-
with_indices=True
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
|
|
40 |
)
|
41 |
-
print(dataset['transcription'][0])
|
42 |
|
43 |
login(token)
|
44 |
|
|
|
32 |
|
33 |
# Replace the original transcription column in the dataset
|
34 |
dataset = dataset.map(
|
35 |
+
lambda examples, idx: {"transcription": updated_dataset["transcription"][idx]},
|
36 |
+
with_indices=True
|
37 |
+
)
|
38 |
+
|
39 |
+
# Filter out rows with empty or whitespace-only transcriptions
|
40 |
+
dataset = dataset.filter(
|
41 |
+
lambda examples: examples["transcription"].strip() != "", # Keep only non-empty transcriptions
|
42 |
)
|
|
|
43 |
|
44 |
login(token)
|
45 |
|