Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Add device control #2

Open
wants to merge 4 commits into
base: NME_SC
Choose a base branch
from
Open

Add device control #2

wants to merge 4 commits into from

Conversation

Jeronymous
Copy link
Member

No description provided.

Comment on lines 43 to 50
elif device=="cpu":
os.environ['CUDA_VISIBLE_DEVICES'] = '-1' # force torch.cuda.is_available() = False
self.device = "cpu"
elif device=="cuda":
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
device_num=torch.cuda.current_device()
to_cuda = f'cuda:{device_num}'
self.device = to_cuda
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two "elif" are useless.
Remove them and Keep It Simple

)

self.window = window
self.period = period


def setup_VAD(self):
model, utils = torch.hub.load(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The device should also be used here

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

Successfully merging this pull request may close these issues.

2 participants