mirror of
https://github.com/meta-llama/llama-stack.git
synced 2026-01-02 17:00:02 +00:00
Fix register_model protocol to return Model
Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
This commit is contained in:
parent
58a040a805
commit
6df600f014
5 changed files with 8 additions and 5 deletions
|
|
@ -300,7 +300,7 @@ class OllamaInferenceAdapter(Inference, ModelsProtocolPrivate):
|
|||
|
||||
return EmbeddingsResponse(embeddings=embeddings)
|
||||
|
||||
async def register_model(self, model: Model):
|
||||
async def register_model(self, model: Model) -> Model:
|
||||
model = await self.register_helper.register_model(model)
|
||||
if model.model_type == ModelType.embedding:
|
||||
logger.info(f"Pulling embedding model `{model.provider_resource_id}` if necessary...")
|
||||
|
|
@ -314,6 +314,8 @@ class OllamaInferenceAdapter(Inference, ModelsProtocolPrivate):
|
|||
f"Model '{model.provider_resource_id}' is not available in Ollama. Available models: {', '.join(available_models)}"
|
||||
)
|
||||
|
||||
return model
|
||||
|
||||
|
||||
async def convert_message_to_openai_dict_for_ollama(message: Message) -> List[dict]:
|
||||
async def _convert_content(content) -> dict:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue