Skip to content

Commit

Permalink
asr_output bugfix while exception handling
Browse files Browse the repository at this point in the history
Signed-off-by: Biswaroop Bhattacharjee <biswaroop08@gmail.com>
  • Loading branch information
biswaroop1547 committed Sep 7, 2021
1 parent aaab5d4 commit d878e39
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dialogy/plugins/text/merge_asr_output/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ def transform(self, training_data: pd.DataFrame) -> pd.DataFrame:
training_data["use"] = True
logger.debug("Transforming training data.")
for i, row in training_data.iterrows():
asr_output = json.loads(row[self.data_column])
asr_output = None
try:
asr_output = json.loads(row[self.data_column])
if asr_output and (merged_asr_ouptut := merge_asr_output(asr_output)):
training_data.loc[i, self.data_column] = merged_asr_ouptut[0]
else:
Expand Down

0 comments on commit d878e39

Please sign in to comment.