mirror of
https://github.com/facefusion/facefusion-labs.git
synced 2026-04-19 15:56:37 +02:00
Restore map_location = 'cpu'
This commit is contained in:
@@ -17,7 +17,7 @@ def export() -> None:
|
||||
opset_version = CONFIG.getint('exporting', 'opset_version')
|
||||
|
||||
makedirs(directory_path, exist_ok = True)
|
||||
model = EmbeddingConverterTrainer.load_from_checkpoint(source_path)
|
||||
model = EmbeddingConverterTrainer.load_from_checkpoint(source_path, map_location = 'cpu')
|
||||
model.eval()
|
||||
model.ir_version = torch.tensor(ir_version)
|
||||
input_tensor = (torch.randn(1, 512), )
|
||||
|
||||
@@ -17,7 +17,7 @@ def export() -> None:
|
||||
opset_version = CONFIG.getint('exporting', 'opset_version')
|
||||
|
||||
makedirs(directory_path, exist_ok = True)
|
||||
state_dict = torch.load(source_path).get('state_dict').get('generator')
|
||||
state_dict = torch.load(source_path, map_location = 'cpu').get('state_dict').get('generator')
|
||||
model = Generator()
|
||||
model.load_state_dict(state_dict)
|
||||
model.eval()
|
||||
|
||||
Reference in New Issue
Block a user