Skip to content

Commit

Permalink
change to actor_cache
Browse files Browse the repository at this point in the history
  • Loading branch information
dansola committed Jan 9, 2025
1 parent f2a09f2 commit 9b91961
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion user_guide/core_concepts/actors/byoc/caching_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
)


@actor.cache
@union.actor_cache
def load_model(state: int) -> callable:
sleep(4) # simulate model loading
return lambda value: state + value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __eq__(self, other):
return self.state == other.state


@actor.cache
@union.actor_cache
def get_state(obj: MyObj) -> int:
sleep(2)
return obj.state
Expand Down
2 changes: 1 addition & 1 deletion user_guide/core_concepts/actors/byoc/caching_map_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def create_model_state() -> union.FlyteFile:
return model_state_path


@actor.cache
@union.actor_cache
def load_model(model_state_path: union.FlyteFile) -> MyModel:
# Simulate model loading time. This can take a long time
# because the FlyteFile download is large, or when the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
)


@actor.cache
@union.actor_cache
def load_model(state: int) -> callable:
sleep(4) # simulate model loading
return lambda value: state + value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __eq__(self, other):
return self.state == other.state


@actor.cache
@union.actor_cache
def get_state(obj: MyObj) -> int:
sleep(2)
return obj.state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def create_model_state() -> union.FlyteFile:
return model_state_path


@actor.cache
@union.actor_cache
def load_model(model_state_path: union.FlyteFile) -> MyModel:
# Simulate model loading time. This can take a long time
# because the FlyteFile download is large, or when the
Expand Down

0 comments on commit 9b91961

Please sign in to comment.