Skip to content

Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! when resuming training #37

Description

@humza-sami

I tried to run example.py on an A100 (80GB) GPU. It seems there is a bug at line [41]

input_ids = tokenizer(prompt, return_tensors="pt").input_ids

The current implementation doesn't load the input_ids tensors onto the device, which causes an error. I replaced the above code, and it's now working. Fixed the issue by adding: input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to("cuda")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions