[Fix] NGRAMWorker.update_weights_from_tensor — delegate to target worker (#24344)
This commit is contained in:
@@ -83,6 +83,15 @@ class NGRAMWorker:
|
||||
def clear_cache_pool(self):
|
||||
self.ngram_corpus.reset()
|
||||
|
||||
def update_weights_from_tensor(self, recv_req):
|
||||
# NGRAM has no draft weights of its own — the n-gram corpus is a CPU
|
||||
# lookup structure built from request token streams — and its
|
||||
# `model_runner` is shared with the target worker. The scheduler
|
||||
# mixin dispatches via `self.draft_worker or self.tp_worker`, so
|
||||
# without this method any caller of `update_weights_from_tensor`
|
||||
# under `--speculative-algorithm NGRAM` raises AttributeError.
|
||||
return self.target_worker.update_weights_from_tensor(recv_req)
|
||||
|
||||
def add_external_corpus(self, corpus_id: str, token_chunks: list[list[int]]) -> int:
|
||||
return self.ngram_corpus.load_external_corpus_named(corpus_id, token_chunks)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user