mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-03 17:29:01 +00:00
Added a comment explaining the client handling in register_model.
This commit is contained in:
parent
f1fd382d51
commit
6a0ee7180b
1 changed files with 3 additions and 0 deletions
|
@ -368,6 +368,9 @@ class VLLMInferenceAdapter(Inference, ModelsProtocolPrivate):
|
||||||
yield chunk
|
yield chunk
|
||||||
|
|
||||||
async def register_model(self, model: Model) -> Model:
|
async def register_model(self, model: Model) -> Model:
|
||||||
|
# register_model is called during Llama Stack initialization, hence we cannot init self.client if not initialized yet.
|
||||||
|
# self.client should only be created after the initialization is complete to avoid asyncio cross-context errors.
|
||||||
|
# Changing this may lead to unpredictable behavior.
|
||||||
client = self._create_client() if self.client is None else self.client
|
client = self._create_client() if self.client is None else self.client
|
||||||
model = await self.register_helper.register_model(model)
|
model = await self.register_helper.register_model(model)
|
||||||
res = await client.models.list()
|
res = await client.models.list()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue