Example #1
0
    def testObjRefCheckpointSerde(self):
        # Obj ref checkpoints are dict checkpoints put into the Ray object
        # store, but they have their own data representation (the obj ref).
        # We thus compare with the actual obj ref checkpoint.
        source_checkpoint = Checkpoint.from_dict({"checkpoint_data": 5})
        obj_ref = source_checkpoint.to_object_ref()
        checkpoint = Checkpoint.from_object_ref(obj_ref)

        self._testCheckpointSerde(checkpoint, *checkpoint.get_internal_representation())
Example #2
0
    def test_fs_checkpoint_obj_store(self):
        """Test conversion from fs to obj store checkpoint and back."""
        if not ray.is_initialized():
            ray.init()

        checkpoint = self._prepare_fs_checkpoint()

        # Convert into obj ref checkpoint
        obj_ref = checkpoint.to_object_ref()

        # Create from object ref
        checkpoint = Checkpoint.from_object_ref(obj_ref)
        self.assertIsInstance(checkpoint._obj_ref, ray.ObjectRef)

        self._assert_fs_checkpoint(checkpoint)
Example #3
0
 def __init__(self):
     checkpoint = Checkpoint.from_object_ref(checkpoint_object_ref)
     self.predictor = TorchPredictor.from_checkpoint(checkpoint)
Example #4
0
 def __init__(self):
     self.predictor = LightGBMPredictor.from_checkpoint(
         Checkpoint.from_object_ref(checkpoint_object_ref)
     )
Example #5
0
 def __init__(self):
     self.predictor = TensorflowPredictor.from_checkpoint(
         Checkpoint.from_object_ref(checkpoint_object_ref),
         model_definition=build_model,
     )
Example #6
0
 def __init__(self):
     self.predictor = XGBoostPredictor.from_checkpoint(
         Checkpoint.from_object_ref(checkpoint_object_ref))