mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-19 12:09:38 +00:00
nuke updates
This commit is contained in:
parent
690e525a36
commit
aa93eeb2b7
15 changed files with 15 additions and 429 deletions
|
|
@ -71,9 +71,6 @@ class MetaReferenceInferenceImpl(Inference, ModelRegistryHelper, ModelsProtocolP
|
|||
f"Model mismatch: {request.model} != {self.model.descriptor()}"
|
||||
)
|
||||
|
||||
async def update_model(self, model: Model) -> None:
|
||||
pass
|
||||
|
||||
async def unregister_model(self, model_id: str) -> None:
|
||||
pass
|
||||
|
||||
|
|
|
|||
|
|
@ -108,9 +108,6 @@ class VLLMInferenceImpl(Inference, ModelsProtocolPrivate):
|
|||
|
||||
return VLLMSamplingParams(**kwargs)
|
||||
|
||||
async def update_model(self, model: Model) -> None:
|
||||
pass
|
||||
|
||||
async def unregister_model(self, model_id: str) -> None:
|
||||
pass
|
||||
|
||||
|
|
|
|||
|
|
@ -48,10 +48,9 @@ class FaissIndex(EmbeddingIndex):
|
|||
self.initialize()
|
||||
|
||||
async def initialize(self) -> None:
|
||||
if not self.kvstore or not self.bank_id:
|
||||
if not self.kvstore:
|
||||
return
|
||||
|
||||
# Load existing index data from kvstore
|
||||
index_key = f"faiss_index:v1::{self.bank_id}"
|
||||
stored_data = await self.kvstore.get(index_key)
|
||||
|
||||
|
|
@ -63,7 +62,6 @@ class FaissIndex(EmbeddingIndex):
|
|||
for k, v in data["chunk_by_index"].items()
|
||||
}
|
||||
|
||||
# Load FAISS index
|
||||
index_bytes = base64.b64decode(data["faiss_index"])
|
||||
self.index = faiss.deserialize_index(index_bytes)
|
||||
|
||||
|
|
@ -71,17 +69,14 @@ class FaissIndex(EmbeddingIndex):
|
|||
if not self.kvstore or not self.bank_id:
|
||||
return
|
||||
|
||||
# Serialize FAISS index
|
||||
index_bytes = faiss.serialize_index(self.index)
|
||||
|
||||
# Prepare data for storage
|
||||
data = {
|
||||
"id_by_index": self.id_by_index,
|
||||
"chunk_by_index": {k: v.json() for k, v in self.chunk_by_index.items()},
|
||||
"faiss_index": base64.b64encode(index_bytes).decode(),
|
||||
}
|
||||
|
||||
# Store in kvstore
|
||||
index_key = f"faiss_index:v1::{self.bank_id}"
|
||||
await self.kvstore.set(key=index_key, value=json.dumps(data))
|
||||
|
||||
|
|
@ -175,15 +170,6 @@ class FaissMemoryImpl(Memory, MemoryBanksProtocolPrivate):
|
|||
del self.cache[memory_bank_id]
|
||||
await self.kvstore.delete(f"{MEMORY_BANKS_PREFIX}{memory_bank_id}")
|
||||
|
||||
async def update_memory_bank(self, memory_bank: MemoryBank) -> None:
|
||||
# Not possible to update the index in place, so we delete and recreate
|
||||
await self.cache[memory_bank.identifier].index.delete()
|
||||
|
||||
self.cache[memory_bank.identifier] = BankWithIndex(
|
||||
bank=memory_bank,
|
||||
index=FaissIndex(ALL_MINILM_L6_V2_DIMENSION, self.kvstore),
|
||||
)
|
||||
|
||||
async def insert_documents(
|
||||
self,
|
||||
bank_id: str,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue