[minor] clean up docs and eos id (#2622)

This commit is contained in:
Lianmin Zheng
2024-12-27 11:23:46 -08:00
committed by GitHub
parent 7a7ac6bea1
commit 751e5ca273
3 changed files with 6 additions and 4 deletions

View File

@@ -15,7 +15,6 @@
import json
import logging
from enum import IntEnum, auto
from functools import lru_cache
from typing import List, Optional, Set, Union
import torch
@@ -48,6 +47,7 @@ class ModelConfig:
self.model_path = model_path
self.revision = revision
self.quantization = quantization
# Parse args
self.model_override_args = json.loads(model_override_args)
self.hf_config = get_config(
@@ -131,6 +131,9 @@ class ModelConfig:
# Veirfy quantization
self._verify_quantization()
# Text attrs
self.hf_eos_token_id = self.get_hf_eos_token_id()
# Multimodel attrs
self.image_token_id = getattr(self.hf_config, "image_token_id", None)
@@ -272,7 +275,6 @@ class ModelConfig:
self.quantization,
)
@lru_cache()
def get_hf_eos_token_id(self) -> Optional[Set[int]]:
eos_ids = getattr(self.hf_config, "eos_token_id", None)
if eos_ids:

View File

@@ -517,7 +517,7 @@ class Scheduler:
stream=recv_req.stream,
lora_path=recv_req.lora_path,
input_embeds=recv_req.input_embeds,
eos_token_ids=self.model_config.get_hf_eos_token_id(),
eos_token_ids=self.model_config.hf_eos_token_id,
)
req.tokenizer = self.tokenizer