mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-03 17:29:01 +00:00
fix provider lookup
This commit is contained in:
parent
52776ca897
commit
ef1dd43351
1 changed files with 20 additions and 9 deletions
|
@ -82,17 +82,28 @@ async def agents_stack(request, inference_model, safety_shield):
|
||||||
inference_models = (
|
inference_models = (
|
||||||
inference_model if isinstance(inference_model, list) else [inference_model]
|
inference_model if isinstance(inference_model, list) else [inference_model]
|
||||||
)
|
)
|
||||||
print(providers)
|
|
||||||
|
|
||||||
print(inference_models, safety_shield)
|
inference_provider = providers["inference"][0]
|
||||||
models = [
|
provider_id = inference_provider.provider_id
|
||||||
ModelInput(
|
if inference_provider.config and "model" in inference_provider.config:
|
||||||
model_id=model,
|
model_to_provider_id = {
|
||||||
model_type=ModelType.llm,
|
provider.config.model: provider.provider_id
|
||||||
provider_id=providers["inference"][i].provider_id,
|
for provider in providers["inference"]
|
||||||
|
}
|
||||||
|
|
||||||
|
models = []
|
||||||
|
for model in inference_models:
|
||||||
|
if model in model_to_provider_id:
|
||||||
|
provider_id = model_to_provider_id[model]
|
||||||
|
|
||||||
|
models.append(
|
||||||
|
ModelInput(
|
||||||
|
model_id=model,
|
||||||
|
model_type=ModelType.llm,
|
||||||
|
provider_id=provider_id,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
for i, model in enumerate(inference_models)
|
|
||||||
]
|
|
||||||
models.append(
|
models.append(
|
||||||
ModelInput(
|
ModelInput(
|
||||||
model_id="all-MiniLM-L6-v2",
|
model_id="all-MiniLM-L6-v2",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue