[CI/Build][MiniCPM-o] Fix NPU accuracy job timeout and silent Daily-O… (#5847)
Signed-off-by: psv666 <2693925048@qq.com> Co-authored-by: amy-why-3459 <wuhaiyan17@huawei.com>
This commit is contained in:
1 parent
d7a22612db
commit
1be47550d0
6 files changed
+40
-6
No files matched your search
@@ -125,11 +125,25 @@ def _get_eval_device() -> str:
|
||||
return explicit
|
||||
try:
|
||||
import torch
|
||||
|
||||
return "cuda:0" if torch.cuda.is_available() else "cpu"
|
||||
except ImportError:
|
||||
return "cpu"
|
||||
|
||||
if torch.cuda.is_available():
|
||||
return "cuda:0"
|
||||
|
||||
# Ascend: ``torch.npu`` only exists once ``torch_npu`` has been imported, which does
|
||||
# not necessarily happen in the benchmark client process. Without this branch the
|
||||
# eval silently lands on CPU, where Whisper-large-v3 needs hours for a full Seed-TTS
|
||||
# run and the CI job is killed by its timeout instead of reporting a WER.
|
||||
try:
|
||||
import torch_npu # noqa: F401
|
||||
except ImportError:
|
||||
pass
|
||||
if hasattr(torch, "npu") and torch.npu.is_available():
|
||||
return "npu:0"
|
||||
|
||||
return "cpu"
|
||||
|
||||
|
||||
def _punctuation_all() -> str:
|
||||
from zhon.hanzi import punctuation
|
||||
|
||||
Reference in new issue
Block a user