fixed error handling

This commit is contained in:
Jennifer Player
2024-03-11 11:46:49 -04:00
committed by psychedelicious
parent 6369ccd05e
commit 5ad048a161
7 changed files with 31 additions and 21 deletions

View File

@ -261,11 +261,16 @@ async def get_hugging_face_models(
hugging_face_repo: str = Query(description="Hugging face repo to search for models", default=None),
) -> List[AnyHttpUrl]:
get_hugging_face_models = ApiDependencies.invoker.services.model_manager.install.get_hugging_face_models
get_hugging_face_models(hugging_face_repo)
result = get_hugging_face_models(
source=hugging_face_repo,
)
try:
result = get_hugging_face_models(
source=hugging_face_repo,
)
except ValueError as e:
raise HTTPException(
status_code=400,
detail=f"{e}",
)
return result