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
0677d91699
commit
3a7b7cf02f
1 changed files with 6 additions and 7 deletions
|
@ -82,18 +82,17 @@ async def agents_stack(request, inference_model, safety_shield):
|
||||||
inference_model if isinstance(inference_model, list) else [inference_model]
|
inference_model if isinstance(inference_model, list) else [inference_model]
|
||||||
)
|
)
|
||||||
|
|
||||||
inference_provider = providers["inference"][0]
|
model_to_provider_id = {}
|
||||||
provider_id = inference_provider.provider_id
|
for provider in providers["inference"]:
|
||||||
if inference_provider.config and "model" in inference_provider.config:
|
if provider.config and "model" in provider.config:
|
||||||
model_to_provider_id = {
|
model_to_provider_id[provider.config["model"]] = provider.provider_id
|
||||||
provider.config["model"]: provider.provider_id
|
|
||||||
for provider in providers["inference"]
|
|
||||||
}
|
|
||||||
|
|
||||||
models = []
|
models = []
|
||||||
for model in inference_models:
|
for model in inference_models:
|
||||||
if model in model_to_provider_id:
|
if model in model_to_provider_id:
|
||||||
provider_id = model_to_provider_id[model]
|
provider_id = model_to_provider_id[model]
|
||||||
|
else:
|
||||||
|
provider_id = providers["inference"][0].provider_id
|
||||||
|
|
||||||
models.append(
|
models.append(
|
||||||
ModelInput(
|
ModelInput(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue