This commit is contained in:
harisreedhar
2025-03-11 14:43:09 +01:00
committed by henryruhs
parent dcf19634d1
commit b47c6b72ee
10 changed files with 112 additions and 170 deletions
+2 -2
View File
@@ -19,6 +19,6 @@ def export() -> None:
makedirs(directory_path, exist_ok = True)
model = EmbeddingConverterTrainer.load_from_checkpoint(source_path, map_location = 'cpu')
model.eval()
model.ir_version = ir_version
input_tensor = torch.randn(1, 512)
model.ir_version = torch.tensor(ir_version)
input_tensor = (torch.randn(1, 512), )
torch.onnx.export(model, input_tensor, target_path, input_names = [ 'input' ], output_names = [ 'output' ], opset_version = opset_version)