_AsyncToSyncSampler
Sync :class:~evsys_sdk.protocols.InferenceClient over an async
:class:~evsys_sdk.training.backend.SamplingClient.
.generate(prompt=...) is called sequentially by
:meth:Benchmark.score from a worker thread; we route the awaited
sample_async call back to the main event loop via
:func:asyncio.run_coroutine_threadsafe so the inner async work
runs on the loop that owns the live training client.
Exposes _tokenizer so :class:ChatTemplatedInference can wrap
this client without further plumbing - same shape
:class:TinkerInference exposes.
Attributes
attributenamestr= 'in_loop_sampler'Functions
func__init__(self, sampler, tokenizer, loop) -> NoneparamselfparamsamplerAnyparamtokenizerAnyparamloopasyncio.AbstractEventLoopReturns
Nonefuncgenerate(self, *, prompt, max_tokens=256, temperature=0.0, stop=None) -> strparamselfparampromptstrparammax_tokensint= 256paramtemperaturefloat= 0.0paramstoplist[str] | None= NoneReturns
strfunc_decode(self, response) -> strparamselfparamresponseAnyReturns
str