[Misc] Move print_*_once from utils to logger (#11298)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk> Signed-off-by: Maxime Fournioux <55544262+mfournioux@users.noreply.github.com> Co-authored-by: Maxime Fournioux <55544262+mfournioux@users.noreply.github.com>
This commit is contained in:
co-authored by
Maxime Fournioux
parent
730e9592e9
commit
d848800e88
@@ -4,7 +4,9 @@ import math
|
||||
from dataclasses import MISSING, dataclass, field, fields
|
||||
from typing import Literal, Optional, Union
|
||||
|
||||
from vllm.utils import print_info_once
|
||||
from vllm.logger import init_logger
|
||||
|
||||
logger = init_logger(__name__)
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -42,7 +44,7 @@ class PEFTHelper:
|
||||
def __post_init__(self):
|
||||
self._validate_features()
|
||||
if self.use_rslora:
|
||||
print_info_once("Loading LoRA weights trained with rsLoRA.")
|
||||
logger.info_once("Loading LoRA weights trained with rsLoRA.")
|
||||
self.vllm_lora_scaling_factor = self.lora_alpha / math.sqrt(self.r)
|
||||
else:
|
||||
self.vllm_lora_scaling_factor = self.lora_alpha / self.r
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
from vllm.logger import init_logger
|
||||
from vllm.platforms import current_platform
|
||||
from vllm.utils import print_info_once
|
||||
|
||||
from .punica_base import PunicaWrapperBase
|
||||
|
||||
logger = init_logger(__name__)
|
||||
|
||||
|
||||
def get_punica_wrapper(*args, **kwargs) -> PunicaWrapperBase:
|
||||
if current_platform.is_cuda_alike():
|
||||
# Lazy import to avoid ImportError
|
||||
from vllm.lora.punica_wrapper.punica_gpu import PunicaWrapperGPU
|
||||
print_info_once("Using PunicaWrapperGPU.")
|
||||
logger.info_once("Using PunicaWrapperGPU.")
|
||||
return PunicaWrapperGPU(*args, **kwargs)
|
||||
elif current_platform.is_hpu():
|
||||
# Lazy import to avoid ImportError
|
||||
from vllm.lora.punica_wrapper.punica_hpu import PunicaWrapperHPU
|
||||
print_info_once("Using PunicaWrapperHPU.")
|
||||
logger.info_once("Using PunicaWrapperHPU.")
|
||||
return PunicaWrapperHPU(*args, **kwargs)
|
||||
else:
|
||||
raise NotImplementedError
|
||||
|
||||
Reference in New Issue
Block a user