Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command line flag to specify device for inference #25

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hvaara
Copy link

@hvaara hvaara commented Nov 25, 2024

This PR adds a new command line flag --device that allows users to specify the device (e.g. cuda, cpu, or mps) to use for inference. The flag defaults to cuda but will automatically fall back to cpu if CUDA is not available. This change also updates the code to use the specified device for loading models and running the pipeline.

torch.manual_seed sets the seed for generating random numbers on all devices. I removed the redundant call to torch.cuda.manual_seed.

This code was generated while working on pytorch/pytorch#141471. Note that LTX-Video does not currently work when using MPS as the backend in latest PyTorch. This is a regression as it worked in PyTorch v2.4.1. Please follow pytorch/pytorch#141471 if you'd like updates on progress towards a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant