mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 18:00:36 +00:00
Fix model_limits KeyError
This commit is contained in:
parent
d45137a399
commit
13142267be
2 changed files with 3 additions and 3 deletions
|
|
@ -1016,7 +1016,7 @@ async def load_data_from_url(url: str) -> str:
|
|||
async with httpx.AsyncClient() as client:
|
||||
r = await client.get(url)
|
||||
resp = r.text
|
||||
return resp
|
||||
return str(resp)
|
||||
raise ValueError(f"Unexpected URL: {type(url)}")
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -283,8 +283,8 @@ class WatsonXInferenceAdapter(LiteLLMOpenAIMixin):
|
|||
# ...
|
||||
provider_resource_id = f"{self.__provider_id__}/{model_spec['model_id']}"
|
||||
if "embedding" in functions:
|
||||
embedding_dimension = model_spec["model_limits"]["embedding_dimension"]
|
||||
context_length = model_spec["model_limits"]["max_sequence_length"]
|
||||
embedding_dimension = model_spec.get("model_limits", {}).get("embedding_dimension", 0)
|
||||
context_length = model_spec.get("model_limits", {}).get("max_sequence_length", 0)
|
||||
embedding_metadata = {
|
||||
"embedding_dimension": embedding_dimension,
|
||||
"context_length": context_length,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue