Move scheduler code from tp_worker.py to scheduler.py (#1538)
This commit is contained in:
@@ -18,7 +18,6 @@ The definition of objects transfered between different
|
||||
processes (TokenizerManager, DetokenizerManager, Controller).
|
||||
"""
|
||||
|
||||
import copy
|
||||
import uuid
|
||||
from dataclasses import dataclass
|
||||
from typing import Dict, List, Optional, Union
|
||||
@@ -53,12 +52,12 @@ class GenerateReqInput:
|
||||
stream: bool = False
|
||||
# The modalities of the image data [image, multi-images, video]
|
||||
modalities: Optional[List[str]] = None
|
||||
|
||||
is_single: bool = True
|
||||
|
||||
# LoRA related
|
||||
lora_path: Optional[Union[List[Optional[str]], Optional[str]]] = None
|
||||
|
||||
# Whether it is a single request or a batch request
|
||||
is_single: bool = True
|
||||
|
||||
def post_init(self):
|
||||
if (self.text is None and self.input_ids is None) or (
|
||||
self.text is not None and self.input_ids is not None
|
||||
@@ -307,10 +306,6 @@ class BatchTokenIDOut:
|
||||
meta_info: List[Dict]
|
||||
finished_reason: List[BaseFinishReason]
|
||||
|
||||
def __post_init__(self):
|
||||
# deepcopy meta_info to avoid modification in place
|
||||
self.meta_info = copy.deepcopy(self.meta_info)
|
||||
|
||||
|
||||
@dataclass
|
||||
class BatchStrOut:
|
||||
|
||||
Reference in New Issue
Block a user