mirror of
https://github.com/NVIDIA/TensorRT-LLM.git
synced 2026-01-28 22:56:13 +08:00
24 lines
669 B
Python
24 lines
669 B
Python
from abc import ABC, abstractmethod
|
|
from typing import Optional
|
|
|
|
from ..pyexecutor.resource_manager import ResourceManager
|
|
from ..pyexecutor.scheduler import ScheduledRequests
|
|
|
|
|
|
class Drafter(ABC):
|
|
"""Abstract base class for all drafter implementations."""
|
|
|
|
@abstractmethod
|
|
def prepare_draft_tokens(
|
|
self,
|
|
scheduled_requests: ScheduledRequests,
|
|
resource_manager: Optional[ResourceManager] = None,
|
|
) -> None:
|
|
"""
|
|
Prepare the drafter tokens for the forward computation this step.
|
|
|
|
Args:
|
|
scheduled_requests: The scheduled requests for this iteration
|
|
"""
|
|
raise NotImplementedError
|