fix text_to_video_synthesis_model device (#751)

Co-authored-by: slin000111 <zhaoshilin2015@sina.con>
This commit is contained in:
slin000111
2024-02-23 17:05:15 +08:00
committed by GitHub
parent 2df76a9304
commit 8a8d273ec3

View File

@@ -58,7 +58,7 @@ class TextToVideoSynthesis(Model):
`True`.
"""
super().__init__(model_dir=model_dir, *args, **kwargs)
self.device = torch.device('cuda') if torch.cuda.is_available() \
self.device = torch.device(kwargs.get('device', 'cuda')) if torch.cuda.is_available() \
else torch.device('cpu')
self.config = Config.from_file(
osp.join(model_dir, ModelFile.CONFIGURATION))