Commit Graph

4 Commits

Author SHA1 Message Date
徐络溟
ecc653871d Fix: export-onnx.py(expected all tensors to be on the same device) (#1699)
由于SenseVoiceSmall.from_pretrained()
    调用的funasr.auto.auto_model.AutoModel.build_model()默认device是cuda
    (在cuda available的环境中)
    ```py
    device = kwargs.get("device", "cuda")
    if not torch.cuda.is_available() or kwargs.get("ngpu", 1) == 0:
        device = "cpu"
        kwargs["batch_size"] = 1
    kwargs["device"] = device
    ```
    而export-onnx.py里的tensor默认都是cpu, 导致
    RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu
    所以直接在加载model的时候指定cpu
2025-01-10 19:26:36 +08:00
Fangjun Kuang
25f0a10468 Add C++ runtime for SenseVoice models (#1148) 2024-07-18 22:54:18 +08:00
Fangjun Kuang
3bae5c3fe5 test exported sense voice models (#1147) 2024-07-18 12:12:44 +08:00
Fangjun Kuang
346f419f39 export sense-voice to onnx (#1144) 2024-07-18 00:18:38 +08:00