Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[seqio/feature_converters]: Better support multi-ranked features in the feature-converter library. #64

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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