def change_external_data_location(model_proto: onnx.ModelProto, new_location: str):
    """Change the external data location in the model.

    :param model_proto: The model proto to modify.
    :param new_location: The new location for the external data.
    """
    for tensor in external_data_helper._get_all_tensors(model_proto):  # pylint: disable=W0212
        if external_data_helper.uses_external_data(tensor):
            # set dummy raw_data since set_external_data expected the field
            tensor.raw_data = b""
            info = external_data_helper.ExternalDataInfo(tensor)
            external_data_helper.set_external_data(
                tensor, new_location, offset=info.offset, length=info.length, checksum=info.checksum
            )
            # clear the raw_data field to avoid saving it and overwriting the info above
            tensor.ClearField("raw_data")
Change the external data location in the model.

    :param model_proto: The model proto to modify.
    :param new_location: The new location for the external data.
    
olive/passes/onnx/common.py