mirror of
https://github.com/NVIDIA/TensorRT-LLM.git
synced 2026-02-03 17:52:19 +08:00
25 lines
629 B
Python
25 lines
629 B
Python
from abc import ABC, abstractmethod
|
|
from typing import Optional
|
|
|
|
from ..pyexecutor.resource_manager import BaseResourceManager
|
|
from ..pyexecutor.scheduler import ScheduledRequests
|
|
|
|
|
|
class Drafter(ABC):
|
|
|
|
def __init__(
|
|
self,
|
|
spec_resource_manager: Optional[BaseResourceManager] = None,
|
|
):
|
|
self.spec_resource_manager = spec_resource_manager
|
|
|
|
@abstractmethod
|
|
def prepare_draft_tokens(
|
|
self,
|
|
scheduled_requests: ScheduledRequests,
|
|
) -> None:
|
|
"""
|
|
Prepare the drafter tokens for the forward computation this step.
|
|
"""
|
|
raise NotImplementedError
|