From 63f45c1e27dae5db2280852a83384276cfc1eff6 Mon Sep 17 00:00:00 2001 From: Dinesh Yeduguru Date: Fri, 1 Nov 2024 10:04:57 -0700 Subject: [PATCH] linter fixes --- llama_stack/apis/datasets/datasets.py | 2 +- llama_stack/apis/models/models.py | 2 +- llama_stack/apis/scoring_functions/scoring_functions.py | 2 +- llama_stack/apis/shields/shields.py | 2 +- llama_stack/distribution/server/server.py | 6 +++--- llama_stack/distribution/store/__init__.py | 6 ++++++ 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/llama_stack/apis/datasets/datasets.py b/llama_stack/apis/datasets/datasets.py index 9cfe1ca36..611590a29 100644 --- a/llama_stack/apis/datasets/datasets.py +++ b/llama_stack/apis/datasets/datasets.py @@ -4,7 +4,7 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from typing import Any, Dict, List, Optional, Protocol +from typing import Dict, List, Optional, Protocol from llama_models.llama3.api.datatypes import URL diff --git a/llama_stack/apis/models/models.py b/llama_stack/apis/models/models.py index 2cb72cb3b..09a0e3d9e 100644 --- a/llama_stack/apis/models/models.py +++ b/llama_stack/apis/models/models.py @@ -4,7 +4,7 @@ # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. -from typing import Any, Dict, List, Optional, Protocol, runtime_checkable +from typing import Dict, List, Optional, Protocol, runtime_checkable from llama_models.schema_utils import json_schema_type, webmethod from pydantic import BaseModel, Field diff --git a/llama_stack/apis/scoring_functions/scoring_functions.py b/llama_stack/apis/scoring_functions/scoring_functions.py index 5311f05f0..af0b0c1ee 100644 --- a/llama_stack/apis/scoring_functions/scoring_functions.py +++ b/llama_stack/apis/scoring_functions/scoring_functions.py @@ -7,9 +7,9 @@ from typing import Dict, List, Optional, Protocol, runtime_checkable from llama_models.schema_utils import json_schema_type, webmethod +from pydantic import BaseModel, Field from llama_stack.apis.common.type_system import JsonType, ParamType -from pydantic import BaseModel, Field @json_schema_type diff --git a/llama_stack/apis/shields/shields.py b/llama_stack/apis/shields/shields.py index 3fb229e17..e59f90f22 100644 --- a/llama_stack/apis/shields/shields.py +++ b/llama_stack/apis/shields/shields.py @@ -5,7 +5,7 @@ # the root directory of this source tree. from enum import Enum -from typing import Any, Dict, List, Optional, Protocol, runtime_checkable +from typing import Dict, List, Optional, Protocol, runtime_checkable from llama_models.schema_utils import json_schema_type, webmethod from pydantic import BaseModel, Field diff --git a/llama_stack/distribution/server/server.py b/llama_stack/distribution/server/server.py index ef1c5ec61..cee517fa8 100644 --- a/llama_stack/distribution/server/server.py +++ b/llama_stack/distribution/server/server.py @@ -22,6 +22,9 @@ import yaml from fastapi import Body, FastAPI, HTTPException, Request, Response from fastapi.exceptions import RequestValidationError from fastapi.responses import JSONResponse, StreamingResponse +from pydantic import BaseModel, ValidationError +from termcolor import cprint +from typing_extensions import Annotated from llama_stack.distribution.distribution import ( builtin_automatically_routed_apis, @@ -36,9 +39,6 @@ from llama_stack.providers.utils.telemetry.tracing import ( SpanStatus, start_trace, ) -from pydantic import BaseModel, ValidationError -from termcolor import cprint -from typing_extensions import Annotated from llama_stack.distribution.datatypes import * # noqa: F403 import llama_stack.distribution.store as distribution_store from llama_stack.distribution.request_headers import set_request_provider_data diff --git a/llama_stack/distribution/store/__init__.py b/llama_stack/distribution/store/__init__.py index 75813f424..e03b931f1 100644 --- a/llama_stack/distribution/store/__init__.py +++ b/llama_stack/distribution/store/__init__.py @@ -1,3 +1,9 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the terms described in the LICENSE file in +# the root directory of this source tree. + from .registry import DiskRegistry, Registry REGISTRY: Registry = None