Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qinxuye committed Sep 2, 2024
1 parent 3e99a96 commit 3987c51
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion xinference/api/restful_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ async def _get_supervisor_ref(self) -> xo.ActorRefType[SupervisorActor]:
async def _get_event_collector_ref(self) -> xo.ActorRefType[EventCollectorActor]:
if self._event_collector_ref is None:
self._event_collector_ref = await xo.actor_ref(
address=self._supervisor_address, uid=EventCollectorActor.uid()
address=self._supervisor_address, uid=EventCollectorActor.default_uid()
)
return self._event_collector_ref

Expand Down
2 changes: 1 addition & 1 deletion xinference/core/cache_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self):
self._model_name_to_version_info: Dict[str, List[Dict]] = {} # type: ignore

@classmethod
def uid(cls) -> str:
def default_uid(cls) -> str:
return "cache_tracker"

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion xinference/core/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self):
)

@classmethod
def uid(cls) -> str:
def default_uid(cls) -> str:
return "event_collector"

def get_model_events(self, model_uid: str) -> List[Dict]:
Expand Down
2 changes: 1 addition & 1 deletion xinference/core/status_guard.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(self):
self._model_uid_to_info: Dict[str, InstanceInfo] = {} # type: ignore

@classmethod
def uid(cls) -> str:
def default_uid(cls) -> str:
return "status_guard"

@staticmethod
Expand Down
8 changes: 5 additions & 3 deletions xinference/core/supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,20 +135,22 @@ async def __post_create__(self):
self._status_guard_ref: xo.ActorRefType[ # type: ignore
"StatusGuardActor"
] = await xo.create_actor(
StatusGuardActor, address=self.address, uid=StatusGuardActor.uid()
StatusGuardActor, address=self.address, uid=StatusGuardActor.default_uid()
)
self._cache_tracker_ref: xo.ActorRefType[ # type: ignore
"CacheTrackerActor"
] = await xo.create_actor(
CacheTrackerActor, address=self.address, uid=CacheTrackerActor.uid()
CacheTrackerActor, address=self.address, uid=CacheTrackerActor.default_uid()
)

from .event import EventCollectorActor

self._event_collector_ref: xo.ActorRefType[ # type: ignore
EventCollectorActor
] = await xo.create_actor(
EventCollectorActor, address=self.address, uid=EventCollectorActor.uid()
EventCollectorActor,
address=self.address,
uid=EventCollectorActor.default_uid(),
)

from ..model.audio import (
Expand Down
6 changes: 3 additions & 3 deletions xinference/core/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,13 @@ async def get_supervisor_ref(self, add_worker: bool = True) -> xo.ActorRefType:
logger.info("Connected to supervisor as a fresh worker")

self._status_guard_ref = await xo.actor_ref(
address=self._supervisor_address, uid=StatusGuardActor.uid()
address=self._supervisor_address, uid=StatusGuardActor.default_uid()
)
self._event_collector_ref = await xo.actor_ref(
address=self._supervisor_address, uid=EventCollectorActor.uid()
address=self._supervisor_address, uid=EventCollectorActor.default_uid()
)
self._cache_tracker_ref = await xo.actor_ref(
address=self._supervisor_address, uid=CacheTrackerActor.uid()
address=self._supervisor_address, uid=CacheTrackerActor.default_uid()
)
# cache_tracker is on supervisor
from ..model.audio import get_audio_model_descriptions
Expand Down

0 comments on commit 3987c51

Please sign in to comment.