mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-18 23:28:53 +00:00
donot use global state
This commit is contained in:
parent
4b6367838f
commit
26a14c1d92
5 changed files with 19 additions and 11 deletions
|
@ -53,8 +53,10 @@ class CommonRoutingTableImpl(RoutingTable):
|
|||
def __init__(
|
||||
self,
|
||||
impls_by_provider_id: Dict[str, RoutedProtocol],
|
||||
dist_registry: distribution_store.Registry,
|
||||
) -> None:
|
||||
self.impls_by_provider_id = impls_by_provider_id
|
||||
self.dist_registry = dist_registry
|
||||
|
||||
async def initialize(self) -> None:
|
||||
self.registry: Registry = {}
|
||||
|
@ -171,7 +173,7 @@ class CommonRoutingTableImpl(RoutingTable):
|
|||
if obj.identifier not in self.registry:
|
||||
self.registry[obj.identifier] = []
|
||||
self.registry[obj.identifier].append(obj)
|
||||
await distribution_store.REGISTRY.register(obj)
|
||||
await self.dist_registry.register(obj)
|
||||
|
||||
|
||||
class ModelsRoutingTable(CommonRoutingTableImpl, Models):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue