Skip to content

Commit 77753c3

Browse files
committed
Fix type union
1 parent 9374e8f commit 77753c3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/transformers/models/t5gemma/configuration_t5gemma.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2020
# See the License for the specific language governing permissions and
2121
# limitations under the License.
22-
from typing import Any, Dict, Optional
22+
from typing import Any, Dict, Optional, Union
2323

2424
from ...configuration_utils import PretrainedConfig, layer_type_validation
2525

@@ -252,8 +252,8 @@ class T5GemmaConfig(PretrainedConfig):
252252

253253
def __init__(
254254
self,
255-
encoder: Optional[T5GemmaModuleConfig | Dict[Any, Any]] = None,
256-
decoder: Optional[T5GemmaModuleConfig | Dict[Any, Any]] = None,
255+
encoder: Optional[Union[T5GemmaModuleConfig, Dict[Any, Any]]] = None,
256+
decoder: Optional[Union[T5GemmaModuleConfig, Dict[Any, Any]]] = None,
257257
is_encoder_decoder: bool = True,
258258
dropout_rate: float = 0.0,
259259
classifier_dropout_rate: float = 0.0,

src/transformers/models/t5gemma/modular_t5gemma.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ class T5GemmaConfig(PretrainedConfig):
229229
}
230230
def __init__(
231231
self,
232-
encoder: Optional[T5GemmaModuleConfig | Dict[Any, Any]] = None,
233-
decoder: Optional[T5GemmaModuleConfig | Dict[Any, Any]] = None,
232+
encoder: Optional[Union[T5GemmaModuleConfig, Dict[Any, Any]]] = None,
233+
decoder: Optional[Union[T5GemmaModuleConfig, Dict[Any, Any]]] = None,
234234
is_encoder_decoder: bool = True,
235235
dropout_rate: float = 0.0,
236236
classifier_dropout_rate: float = 0.0,

0 commit comments

Comments
 (0)