Skip to content

Commit fc8eda3

Browse files
authored
fix: Fixed type annotation for compatability with python 3.8 (#30243)
* Fixed type annotation for compatability with python 3.8 * Fixed unsorted imports.
1 parent b6b6daf commit fc8eda3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/transformers/models/whisper/convert_openai_to_hf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import tempfile
2222
import urllib
2323
import warnings
24-
from typing import Any, Optional, Tuple
24+
from typing import Any, List, Optional, Tuple
2525

2626
import torch
2727
from huggingface_hub.utils import insecure_hashlib
@@ -252,7 +252,7 @@ def convert_openai_whisper_to_tfms(
252252

253253

254254
# Adapted from https://github.com/openai/tiktoken/issues/60#issuecomment-1499977960
255-
def _bpe(mergeable_ranks, token: bytes, max_rank=None) -> list[bytes]:
255+
def _bpe(mergeable_ranks, token: bytes, max_rank=None) -> List[bytes]:
256256
parts = [bytes([b]) for b in token]
257257
while True:
258258
min_idx = None

0 commit comments

Comments
 (0)