From 1bcf484d83693ae7ab5ffd2886a1841e4459312a Mon Sep 17 00:00:00 2001 From: Dinesh Yeduguru Date: Fri, 1 Nov 2024 14:24:50 -0700 Subject: [PATCH] precommit failures fixed --- llama_stack/apis/datasets/datasets.py | 4 ++-- .../apis/scoring_functions/scoring_functions.py | 4 ++-- llama_stack/distribution/server/server.py | 6 +++--- llama_stack/distribution/store/__init__.py | 2 +- llama_stack/distribution/store/registry.py | 6 ++++++ .../distribution/store/tests/test_registry.py | 12 ++++++++---- 6 files changed, 22 insertions(+), 12 deletions(-) diff --git a/llama_stack/apis/datasets/datasets.py b/llama_stack/apis/datasets/datasets.py index 5d083b8db..4c5540b72 100644 --- a/llama_stack/apis/datasets/datasets.py +++ b/llama_stack/apis/datasets/datasets.py @@ -10,10 +10,10 @@ from llama_models.llama3.api.datatypes import URL from llama_models.schema_utils import json_schema_type, webmethod -from llama_stack.apis.common.type_system import ParamType - from pydantic import BaseModel, Field +from llama_stack.apis.common.type_system import ParamType + @json_schema_type class DatasetDef(BaseModel): diff --git a/llama_stack/apis/scoring_functions/scoring_functions.py b/llama_stack/apis/scoring_functions/scoring_functions.py index 0a4ff6316..bf612bda0 100644 --- a/llama_stack/apis/scoring_functions/scoring_functions.py +++ b/llama_stack/apis/scoring_functions/scoring_functions.py @@ -7,10 +7,10 @@ from typing import Dict, List, Literal, Optional, Protocol, runtime_checkable from llama_models.schema_utils import json_schema_type, webmethod - -from llama_stack.apis.common.type_system import JsonType, ParamType from pydantic import BaseModel, Field +from llama_stack.apis.common.type_system import ParamType + @json_schema_type class Parameter(BaseModel): diff --git a/llama_stack/distribution/server/server.py b/llama_stack/distribution/server/server.py index 2d9777736..aafa6741d 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 b294efc73..cd1080f3a 100644 --- a/llama_stack/distribution/store/__init__.py +++ b/llama_stack/distribution/store/__init__.py @@ -4,4 +4,4 @@ # 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 +from .registry import * # noqa: F401 F403 diff --git a/llama_stack/distribution/store/registry.py b/llama_stack/distribution/store/registry.py index 28013c5e3..95a393aa5 100644 --- a/llama_stack/distribution/store/registry.py +++ b/llama_stack/distribution/store/registry.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. + import json from typing import Protocol diff --git a/llama_stack/distribution/store/tests/test_registry.py b/llama_stack/distribution/store/tests/test_registry.py index 8ddb61945..69c690673 100644 --- a/llama_stack/distribution/store/tests/test_registry.py +++ b/llama_stack/distribution/store/tests/test_registry.py @@ -1,10 +1,14 @@ +# 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. + import os import pytest -import pytest_asyncio -from llama_stack.distribution.store import * -from llama_stack.apis.memory_banks import GraphMemoryBankDef, VectorMemoryBankDef -from llama_stack.distribution.utils.config_dirs import DISTRIBS_BASE_DIR +from llama_stack.distribution.store import * # noqa: F403 +from llama_stack.apis.memory_banks import VectorMemoryBankDef from llama_stack.providers.utils.kvstore import kvstore_impl, SqliteKVStoreConfig from llama_stack.distribution.datatypes import * # noqa: F403