MCPcopy Create free account
hub / github.com/agentscope-ai/Trinity-RFT / get_model

Method get_model

trinity/common/models/allocator.py:150–162  ·  view source on GitHub ↗

Get the model actor for the given role and engine ID.

(self, config: InferenceModelConfig, role: str, engine_id: int)

Source from the content-addressed store, hash-verified

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
165async def get_model_wrapper(

Callers 3

__init__Method · 0.95
get_debug_modelsFunction · 0.95
prepareMethod · 0.95

Calls 3

get_actor_nameMethod · 0.95
ModelWrapperClass · 0.90
get_actorMethod · 0.45

Tested by

no test coverage detected