mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-25 05:52:00 +00:00
chore: add mypy inference fp8_impls
Signed-off-by: Mustafa Elbehery <melbeher@redhat.com>
This commit is contained in:
parent
d880c2df0e
commit
1c08a1cae9
7 changed files with 38 additions and 25 deletions
|
|
@ -54,6 +54,7 @@ class DistributionInspectImpl(Inspect):
|
|||
provider_types=[], # These APIs don't have "real" providers - they're internal to the stack
|
||||
)
|
||||
for e in endpoints
|
||||
if e.methods
|
||||
]
|
||||
)
|
||||
else:
|
||||
|
|
@ -63,10 +64,11 @@ class DistributionInspectImpl(Inspect):
|
|||
[
|
||||
RouteInfo(
|
||||
route=e.path,
|
||||
method=next(iter([m for m in e.methods if m != "HEAD"])),
|
||||
method=next(iter([m for m in e.methods if m != "HEAD"])) if e.methods else "POST",
|
||||
provider_types=[p.provider_type for p in providers],
|
||||
)
|
||||
for e in endpoints
|
||||
if e.methods
|
||||
]
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -64,9 +64,7 @@ def get_all_api_routes() -> dict[Api, list[Route]]:
|
|||
http_method = hdrs.METH_DELETE
|
||||
else:
|
||||
http_method = hdrs.METH_POST
|
||||
routes.append(
|
||||
Route(path=path, methods=[http_method], name=name, endpoint=None)
|
||||
) # setting endpoint to None since don't use a Router object
|
||||
routes.append(Route(path=path, methods=[http_method], name=name, endpoint=None))
|
||||
|
||||
apis[api] = routes
|
||||
|
||||
|
|
@ -95,6 +93,8 @@ def initialize_route_impls(impls: dict[Api, Any]) -> RouteImpls:
|
|||
impl = impls[api]
|
||||
func = getattr(impl, route.name)
|
||||
# Get the first (and typically only) method from the set, filtering out HEAD
|
||||
if route.methods is None:
|
||||
continue # Skip if no methods are available
|
||||
available_methods = [m for m in route.methods if m != "HEAD"]
|
||||
if not available_methods:
|
||||
continue # Skip if only HEAD method is available
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue