mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-29 15:23:51 +00:00
clean up
This commit is contained in:
parent
d8fab77a4f
commit
bc4ac2ceb4
4 changed files with 28 additions and 36 deletions
|
@ -389,12 +389,7 @@ def main(yaml_config: str, port: int = 5000, disable_ipv6: bool = False):
|
|||
cprint(f"StackRunConfig: {config}", "blue")
|
||||
app = FastAPI()
|
||||
|
||||
# check if routing table exists
|
||||
if config.provider_routing_table is not None:
|
||||
impls, specs = asyncio.run(resolve_impls_with_routing(config))
|
||||
else:
|
||||
# keeping this for backwards compatibility
|
||||
impls, specs = asyncio.run(resolve_impls(config.provider_map))
|
||||
|
||||
if Api.telemetry in impls:
|
||||
setup_logger(impls[Api.telemetry])
|
||||
|
|
|
@ -33,7 +33,6 @@ async def instantiate_provider(
|
|||
|
||||
assert isinstance(provider_config, GenericProviderConfig)
|
||||
config_type = instantiate_class_type(provider_spec.config_class)
|
||||
print("!!!", provider_config)
|
||||
config = config_type(**provider_config.config)
|
||||
args = [config, deps]
|
||||
elif isinstance(provider_spec, RouterProviderSpec):
|
||||
|
|
|
@ -128,36 +128,35 @@ class PGVectorMemoryAdapter(Memory):
|
|||
self.cache = {}
|
||||
|
||||
async def initialize(self) -> None:
|
||||
print("Init PGVector!")
|
||||
# try:
|
||||
# self.conn = psycopg2.connect(
|
||||
# host=self.config.host,
|
||||
# port=self.config.port,
|
||||
# database=self.config.db,
|
||||
# user=self.config.user,
|
||||
# password=self.config.password,
|
||||
# )
|
||||
# self.cursor = self.conn.cursor()
|
||||
try:
|
||||
self.conn = psycopg2.connect(
|
||||
host=self.config.host,
|
||||
port=self.config.port,
|
||||
database=self.config.db,
|
||||
user=self.config.user,
|
||||
password=self.config.password,
|
||||
)
|
||||
self.cursor = self.conn.cursor()
|
||||
|
||||
# version = check_extension_version(self.cursor)
|
||||
# if version:
|
||||
# print(f"Vector extension version: {version}")
|
||||
# else:
|
||||
# raise RuntimeError("Vector extension is not installed.")
|
||||
version = check_extension_version(self.cursor)
|
||||
if version:
|
||||
print(f"Vector extension version: {version}")
|
||||
else:
|
||||
raise RuntimeError("Vector extension is not installed.")
|
||||
|
||||
# self.cursor.execute(
|
||||
# """
|
||||
# CREATE TABLE IF NOT EXISTS metadata_store (
|
||||
# key TEXT PRIMARY KEY,
|
||||
# data JSONB
|
||||
# )
|
||||
# """
|
||||
# )
|
||||
# except Exception as e:
|
||||
# import traceback
|
||||
self.cursor.execute(
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS metadata_store (
|
||||
key TEXT PRIMARY KEY,
|
||||
data JSONB
|
||||
)
|
||||
"""
|
||||
)
|
||||
except Exception as e:
|
||||
import traceback
|
||||
|
||||
# traceback.print_exc()
|
||||
# raise RuntimeError("Could not connect to PGVector database server") from e
|
||||
traceback.print_exc()
|
||||
raise RuntimeError("Could not connect to PGVector database server") from e
|
||||
|
||||
async def shutdown(self) -> None:
|
||||
pass
|
||||
|
|
|
@ -68,8 +68,7 @@ class FaissMemoryImpl(Memory):
|
|||
self.config = config
|
||||
self.cache = {}
|
||||
|
||||
async def initialize(self) -> None:
|
||||
print("INIT meta-reference")
|
||||
async def initialize(self) -> None: ...
|
||||
|
||||
async def shutdown(self) -> None: ...
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue