Skip to content

Commit

Permalink
Merge pull request #2 from Arcmoon-Hu/dev
Browse files Browse the repository at this point in the history
Add some coding rule
  • Loading branch information
Arcmoon-Hu authored Jan 23, 2024
2 parents c794178 + d27cf43 commit 8ba7d47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions python/sglang/srt/managers/router/model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ def load_model(self):
break
if arch == "QWenLMHeadModel":
model_class = QWenLMHeadModel
break
if model_class is None:
raise ValueError(f"Unsupported architectures: {architectures}")

Expand Down
5 changes: 2 additions & 3 deletions python/sglang/srt/model_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ def __init__(
self.context_len = get_context_length(self.hf_config)
self.head_dim = self.hf_config.hidden_size // self.hf_config.num_attention_heads
self.num_attention_heads = self.hf_config.num_attention_heads
try:
self.num_key_value_heads = self.hf_config.num_key_value_heads
except Exception as e:
num_key_value_heads = getattr(self.hf_config, "num_key_value_heads", None)
if num_key_value_heads is None:
self.num_key_value_heads = self.num_attention_heads
self.hidden_size = self.hf_config.hidden_size
self.num_hidden_layers = self.hf_config.num_hidden_layers
Expand Down

0 comments on commit 8ba7d47

Please sign in to comment.