mirror of
https://github.com/openai/whisper.git
synced 2025-11-24 06:26:03 +00:00
Merge 2864a37293898968e5adf0061254d9432282c813 into c0d2f624c09dc18e709e37c2ad90c039a4eb72a2
This commit is contained in:
commit
ce9bd47837
@ -54,8 +54,8 @@ _ALIGNMENT_HEADS = {
|
|||||||
def _download(url: str, root: str, in_memory: bool) -> Union[bytes, str]:
|
def _download(url: str, root: str, in_memory: bool) -> Union[bytes, str]:
|
||||||
os.makedirs(root, exist_ok=True)
|
os.makedirs(root, exist_ok=True)
|
||||||
|
|
||||||
expected_sha256 = url.split("/")[-2]
|
expected_sha256, basename = url.split("/")[-2:]
|
||||||
download_target = os.path.join(root, os.path.basename(url))
|
download_target = os.path.join(root, basename)
|
||||||
|
|
||||||
if os.path.exists(download_target) and not os.path.isfile(download_target):
|
if os.path.exists(download_target) and not os.path.isfile(download_target):
|
||||||
raise RuntimeError(f"{download_target} exists and is not a regular file")
|
raise RuntimeError(f"{download_target} exists and is not a regular file")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user