Skip to content

Commit

Permalink
fix: Fixed type annotation for compatability with python 3.8 (#30243)
Browse files Browse the repository at this point in the history
* Fixed type annotation for compatability with python 3.8

* Fixed unsorted imports.
  • Loading branch information
Sai-Suraj-27 committed Apr 15, 2024
1 parent b6b6daf commit fc8eda3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transformers/models/whisper/convert_openai_to_hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import tempfile
import urllib
import warnings
from typing import Any, Optional, Tuple
from typing import Any, List, Optional, Tuple

import torch
from huggingface_hub.utils import insecure_hashlib
Expand Down Expand Up @@ -252,7 +252,7 @@ def convert_openai_whisper_to_tfms(


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

0 comments on commit fc8eda3

Please sign in to comment.