Skip to content

Commit

Permalink
fix attn_bias default value
Browse files Browse the repository at this point in the history
  • Loading branch information
deepindeed2022 committed Nov 8, 2024
1 parent 48d1a5c commit 4c55c8d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lmdeploy/turbomind/deploy/source_model/llava.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self, model_path: str, tokenizer_path: str, **kwargs):
config = getattr(config, 'text_config', config)
arch = config.architectures[0]
_readers = dict(Qwen2ForCausalLM=LlavaReader,
LlamaForCausalL=LlavaReader)
LlamaForCausalLM=LlavaReader)
self.Reader = _readers[arch]
self.arch = arch

Expand Down Expand Up @@ -63,7 +63,9 @@ def model_info(self):
hidden_units = model_arg.get('hidden_size', 4096)
vocab_size = model_arg.get('vocab_size', 152000)
intermediate_size = model_arg.get('intermediate_size', 11008)
attn_bias = int(model_arg.get('attn_bias', 1))
attn_bias = 1 if model_arg['architectures'][0] \
== 'Qwen2ForCausalLM' else 0
attn_bias = int(model_arg.get('attn_bias', attn_bias))
use_logn_attn = int(model_arg.get('use_logn_attn', 0))

if isinstance(rope_scaling, dict):
Expand Down

0 comments on commit 4c55c8d

Please sign in to comment.