diff --git a/docs/references/contributor_guide.md b/docs/references/contributor_guide.md index 2896b2b8e..15be5a703 100644 --- a/docs/references/contributor_guide.md +++ b/docs/references/contributor_guide.md @@ -19,4 +19,4 @@ Add unit tests under [sglang/test](https://github.com/sgl-project/sglang/tree/ma ## For Newcomers If you want to contribute or learn but don't have a concrete idea yet, you can pick a task labeled as "good first issue" or "help wanted" from the list below. -https://github.com/sgl-project/sglang/issues?q=is%3Aissue+label%3A%22good+first+issue%22%2C%22help+wanted%22 +[https://github.com/sgl-project/sglang/issues?q=is%3Aissue+label%3A%22good+first+issue%22%2C%22help+wanted%22](https://github.com/sgl-project/sglang/issues?q=is%3Aissue+label%3A%22good+first+issue%22%2C%22help+wanted%22) diff --git a/python/sglang/srt/configs/model_config.py b/python/sglang/srt/configs/model_config.py index 574a031ad..c3f6ba993 100644 --- a/python/sglang/srt/configs/model_config.py +++ b/python/sglang/srt/configs/model_config.py @@ -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: diff --git a/python/sglang/srt/managers/scheduler.py b/python/sglang/srt/managers/scheduler.py index 8fe10eb99..7feaaedb8 100644 --- a/python/sglang/srt/managers/scheduler.py +++ b/python/sglang/srt/managers/scheduler.py @@ -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