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

fix: Fixed type annotation for compatability with python 3.8 #30243

Merged
merged 2 commits into from
Apr 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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, Optional, Tuple, List

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