Skip to content

main.py hard-codes CUDA and crashes on CPU/Ascend/NPU machines #44

Description

@li-lizhe

Description

The example calls unconditionally. On machines without a CUDA GPU, this raises an error before the model is even loaded.

Reproduction

Run on a CPU-only or Ascend NPU environment:

Expected

The script should detect the available device and fall back to CPU when CUDA is not present.

Proposed fix

Use to decide the target device.

I have submitted PR #43 with the fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions