From a139a6ae2b84b24af3d8cf1a17c28b890c006764 Mon Sep 17 00:00:00 2001 From: Kacper Krasowiak Date: Mon, 22 Jul 2024 17:04:43 +0000 Subject: [PATCH] fix: Update to the version number before the next release. Change-Id: I06df651e7b51719e2c72d713a4fd291c1eac8dfa --- ariel/__init__.py | 2 +- ariel/dubbing.py | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ariel/__init__.py b/ariel/__init__.py index 7f9f7d3..362cb4a 100644 --- a/ariel/__init__.py +++ b/ariel/__init__.py @@ -13,4 +13,4 @@ # limitations under the License. """Ariel library for for end-to-end video ad dubbing using AI.""" -__version__ = "0.0.1" \ No newline at end of file +__version__ = "0.0.2" \ No newline at end of file diff --git a/ariel/dubbing.py b/ariel/dubbing.py index 6632538..049b9a3 100644 --- a/ariel/dubbing.py +++ b/ariel/dubbing.py @@ -809,10 +809,14 @@ def _update_utterance_metadata( *, updated_utterance: Mapping[str, str | float], utterance_metadata: Sequence[Mapping[str, str | float]], + edit_index: int | None = None ) -> Sequence[Mapping[str, str | float]]: """Runs the update process of the added utterance.""" utterance_metadata_copy = utterance_metadata.copy() - utterance_metadata_copy.append(updated_utterance) + if edit_index: + utterance_metadata_copy[edit_index] = updated_utterance + else: + utterance_metadata_copy.append(updated_utterance) utterance_metadata_copy.sort(key=lambda item: (item["start"], item["end"])) added_index = utterance_metadata_copy.index(updated_utterance) + 1 print(f"Item added / modified at position {added_index}.") @@ -982,14 +986,18 @@ def _run_verify_utterance_metadata(self) -> None: edited_utterance = self._run_translation_on_single_utterance( edited_utterance ) - utterance_metadata[edit_index] = edited_utterance + utterance_metadata = self._update_utterance_metadata( + updated_utterance=edited_utterance, + utterance_metadata=utterance_metadata, + edit_index=edit_index, + ) elif action_choice == "add": added_utterance = self._add_utterance_metadata() - updated_utterance = self._repopulate_metadata( + added_utterance = self._repopulate_metadata( utterance=added_utterance, modified=False ) utterance_metadata = self._update_utterance_metadata( - updated_utterance=updated_utterance, + updated_utterance=added_utterance, utterance_metadata=utterance_metadata, ) elif action_choice == "remove":