FROM pytorch/pytorch:1.9.0-cuda10.2-cudnn7-runtime
WORKDIR /workspace
RUN apt-get update && apt-get install -y \
build-essential \
gcc \
git \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip
RUN pip install git+https://github.com/openai/whisper.git
試してみるとエラーになった
root@dfbc095388f8:/workspace# whisper mtg02.m4a --language ja --model large
Traceback (most recent call last):
File "/opt/conda/bin/whisper", line 5, in <module>
from whisper.transcribe import cli
File "/opt/conda/lib/python3.7/site-packages/whisper/__init__.py", line 12, in <module>
from .decoding import DecodingOptions, DecodingResult, decode, detect_language
File "/opt/conda/lib/python3.7/site-packages/whisper/decoding.py", line 514
if prefix := self.options.prefix:
^
SyntaxError: invalid syntax
cudaのバージョン問題
参考にさせていただいたページにもあるように、pytorch をPCにあった cuda バージョンにする必要があります。
cudaバージョンの確認方法は、コマンドプロンプトで
>nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Jun__8_16:59:34_Pacific_Daylight_Time_2022
Cuda compilation tools, release 11.7, V11.7.99
Build cuda_11.7.r11.7/compiler.31442593_0
FROM pytorch/pytorch:1.13.1-cuda11.6-cudnn8-runtime
modelのダウンロードエラー?
実行してみると。。。
root@401ac01bcb2c:/workspace# whisper mtg03.m4a --language ja --model large
0%|▏ | 12.3M/2.87G [00:02<11:43, 4.37MiB/s]
Traceback (most recent call last):
File "/opt/conda/bin/whisper", line 8, in <module>
sys.exit(cli())
File "/opt/conda/lib/python3.10/site-packages/whisper/transcribe.py", line 310, in cli
model = load_model(model_name, device=device, download_root=model_dir)
File "/opt/conda/lib/python3.10/site-packages/whisper/__init__.py", line 108, in load_model
checkpoint_file = _download(_MODELS[name], download_root, in_memory)
File "/opt/conda/lib/python3.10/site-packages/whisper/__init__.py", line 62, in _download
raise RuntimeError("Model has been downloaded but the SHA256 checksum does not not match. Please retry loading the model.")
RuntimeError: Model has been downloaded but the SHA256 checksum does not not match. Please retry loading the model.
ん、Modelのダウンロードに失敗した? リトライしろってあるのでもう一度やってみる
root@401ac01bcb2c:/workspace# whisper mtg03.m4a --language ja --model large
/opt/conda/lib/python3.10/site-packages/whisper/__init__.py:48: UserWarning: /root/.cache/whisper/large-v2.pt exists, but the SHA256 checksum does not match; re-downloading the file
warnings.warn(f"{download_target} exists, but the SHA256 checksum does not match; re-downloading the file")
23%|████████▌ | 667M/2.87G [01:34<05:55, 6.71MiB/s]
c:\Dev\buildspace\ethreum-dapp\my-wave-portal>npx hardhat test
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
Compiled 1 Solidity file successfully
Lock
Deployment
1) Should set the right unlockTime
√ Should set the right owner
2) Should receive and store the funds to lock
3) Should fail if the unlockTime is not in the future
Withdrawals
Validations
4) Should revert with the right error if called too soon
5) Should revert with the right error if called from another account
6) Shouldn't fail if the unlockTime has arrived and the owner calls it
Events
7) Should emit an event on withdrawals
Transfers
8) Should transfer the funds to the owner
1 passing (2s)
8 failing
1) Lock
Deployment
Should set the right unlockTime:
AssertionError: expected BigNumber { value: "1705326131" } to equal 1705326131
at Context.<anonymous> (C:\Dev\buildspace\ethreum-dapp\my-wave-portal\test\Lock.js:32:42)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at runNextTicks (node:internal/process/task_queues:65:3)
at listOnTimeout (node:internal/timers:528:9)
at processTimers (node:internal/timers:502:7)
2) Lock
Deployment
Should receive and store the funds to lock:
AssertionError: expected BigNumber { value: "1000000000" } to equal 1000000000
at Context.<anonymous> (C:\Dev\buildspace\ethreum-dapp\my-wave-portal\test\Lock.js:46:65)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at runNextTicks (node:internal/process/task_queues:65:3)
at listOnTimeout (node:internal/timers:528:9)
at processTimers (node:internal/timers:502:7)
3) Lock
Deployment
Should fail if the unlockTime is not in the future:
Error: Invalid Chai property: revertedWith
at Object.proxyGetter [as get] (C:\Dev\buildspace\ethreum-dapp\my-wave-portal\node_modules\chai\lib\chai\utils\proxify.js:78:17)
at Context.<anonymous> (C:\Dev\buildspace\ethreum-dapp\my-wave-portal\test\Lock.js:55:64)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
4) Lock
Withdrawals
Validations
Should revert with the right error if called too soon:
Error: Invalid Chai property: revertedWith
at Object.proxyGetter [as get] (C:\Dev\buildspace\ethreum-dapp\my-wave-portal\node_modules\chai\lib\chai\utils\proxify.js:78:17)
at Context.<anonymous> (C:\Dev\buildspace\ethreum-dapp\my-wave-portal\test\Lock.js:66:44)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
5) Lock
Withdrawals
Validations
Should revert with the right error if called from another account:
Error: Invalid Chai property: revertedWith
at Object.proxyGetter [as get] (C:\Dev\buildspace\ethreum-dapp\my-wave-portal\node_modules\chai\lib\chai\utils\proxify.js:78:17)
at Context.<anonymous> (C:\Dev\buildspace\ethreum-dapp\my-wave-portal\test\Lock.js:80:66)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
6) Lock
Withdrawals
Validations
Shouldn't fail if the unlockTime has arrived and the owner calls it:
Error: Invalid Chai property: reverted
at Object.proxyGetter [as get] (C:\Dev\buildspace\ethreum-dapp\my-wave-portal\node_modules\chai\lib\chai\utils\proxify.js:78:17)
at Context.<anonymous> (C:\Dev\buildspace\ethreum-dapp\my-wave-portal\test\Lock.js:93:48)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
7) Lock
Withdrawals
Events
Should emit an event on withdrawals:
Error: Invalid Chai property: emit. Did you mean "exist"?
at Object.proxyGetter [as get] (C:\Dev\buildspace\ethreum-dapp\my-wave-portal\node_modules\chai\lib\chai\utils\proxify.js:75:17)
at Context.<anonymous> (C:\Dev\buildspace\ethreum-dapp\my-wave-portal\test\Lock.js:106:14)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
8) Lock
Withdrawals
Transfers
Should transfer the funds to the owner:
Error: Invalid Chai property: changeEtherBalances
at Object.proxyGetter [as get] (C:\Dev\buildspace\ethreum-dapp\my-wave-portal\node_modules\chai\lib\chai\utils\proxify.js:78:17)
at Context.<anonymous> (C:\Dev\buildspace\ethreum-dapp\my-wave-portal\test\Lock.js:119:41)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
PS C:\dev\buildspace\ethreum-dapp\my-wave-portal> npx hardhat test
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
Lock
Deployment
√ Should set the right unlockTime (1301ms)
√ Should set the right owner
√ Should receive and store the funds to lock
√ Should fail if the unlockTime is not in the future
Withdrawals
Validations
√ Should revert with the right error if called too soon (66ms)
√ Should revert with the right error if called from another account
√ Shouldn't fail if the unlockTime has arrived and the owner calls it
Events
√ Should emit an event on withdrawals
Transfers
√ Should transfer the funds to the owner
9 passing (2s)