Get the model actor for the given role and engine ID.
(self, config: InferenceModelConfig, role: str, engine_id: int)
| 148 | return rollout_models, auxiliary_models |
| 149 | |
| 150 | def get_model(self, config: InferenceModelConfig, role: str, engine_id: int) -> ModelWrapper: |
| 151 | """Get the model actor for the given role and engine ID.""" |
| 152 | actor_name = self.get_actor_name(role, engine_id, 0) |
| 153 | try: |
| 154 | model_actor = ray.get_actor(actor_name, namespace=config.ray_namespace) |
| 155 | return ModelWrapper(model=model_actor, config=config) |
| 156 | except ValueError: |
| 157 | self.logger.error( |
| 158 | "Actor %s not found in %s. Make sure the model is created.", |
| 159 | actor_name, |
| 160 | config.ray_namespace, |
| 161 | ) |
| 162 | raise |
| 163 | |
| 164 | |
| 165 | async def get_model_wrapper( |
no test coverage detected