ELMoForManyLangs
ELMoForManyLangs copied to clipboard
The size of output model is very large when exporting to ONNX format.
I am exporting Embedder to ONNX format. But the size of output model is so large(~7G) that I doubt there are many duplications of weights. How to export Embedder correctly?
Code snippet:
model = Embedder(elmo_model_dir).get_model()[0]
torch.onnx.export(model, (w, c, masks), 'output_model.onnx', export_params=True, opset_version=12, do_constant_folding=True, input_names=['w', 'c', 'masks'], output_names=['logits'], use_external_data_format=True)