Skip to content

Commit

Permalink
[seqio/feature_converters]: Better support multi-ranked features in t…
Browse files Browse the repository at this point in the history
…he feature-converter library.

PiperOrigin-RevId: 461897686
  • Loading branch information
liviosoares authored and Magenta Team committed Jul 19, 2022
1 parent bdb3b3c commit 9c7f37f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mt3/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"""Feature converter and model for continuous inputs."""

from typing import Mapping
from typing import Mapping, Sequence, Union
import seqio
from t5x import decoding
from t5x import models
Expand Down Expand Up @@ -98,7 +98,8 @@ def convert_example(
convert_example, num_parallel_calls=tf.data.experimental.AUTOTUNE)

def get_model_feature_lengths(
self, task_feature_lengths: Mapping[str, int]) -> Mapping[str, int]:
self, task_feature_lengths: Mapping[str, Union[int, Sequence[int]]]
) -> Mapping[str, Union[int, Sequence[int]]]:
"""Define the length relationship between input and output features."""
encoder_length = task_feature_lengths["inputs"]
decoder_length = task_feature_lengths["targets"]
Expand Down

0 comments on commit 9c7f37f

Please sign in to comment.