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

Method generate

trinity/common/models/model.py:505–511  ·  view source on GitHub ↗

Generate a list of experiences from a list of prompts.

(self, prompts: List[str], **kwargs)

Source from the content-addressed store, hash-verified

503
504 @_history_recorder
505 def generate(self, prompts: List[str], **kwargs) -> List[Experience]:
506 """Generate a list of experiences from a list of prompts."""
507 lora_request = self.get_lora_request()
508 results = ray.get(
509 [self.model.generate.remote(prompt, lora_request, **kwargs) for prompt in prompts]
510 )
511 return [exp for exps in results for exp in exps]
512
513 @_history_recorder
514 async def generate_async(self, prompts: List[str], **kwargs) -> List[Experience]:

Callers 3

_call_local_vllmFunction · 0.45
rolloutFunction · 0.45
eval_sampleFunction · 0.45

Calls 3

get_lora_requestMethod · 0.95
remoteMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected