Suppport qwen model and solve some problems (#75)
This commit is contained in:
@@ -55,6 +55,7 @@ class DetokenizerManager:
|
||||
first_token = self.tokenizer.convert_ids_to_tokens(
|
||||
int(output_tokens[i][0])
|
||||
)
|
||||
first_token = first_token.decode("utf-8")
|
||||
if first_token.startswith("▁"):
|
||||
output_strs[i] = " " + output_strs[i]
|
||||
|
||||
|
||||
@@ -240,6 +240,7 @@ class ModelRunner:
|
||||
from sglang.srt.models.llama2 import LlamaForCausalLM
|
||||
from sglang.srt.models.llava import LlavaLlamaForCausalLM
|
||||
from sglang.srt.models.mixtral import MixtralForCausalLM
|
||||
from sglang.srt.models.qwen import QWenLMHeadModel
|
||||
|
||||
# Select model class
|
||||
architectures = getattr(self.model_config.hf_config, "architectures", [])
|
||||
@@ -258,6 +259,9 @@ class ModelRunner:
|
||||
if arch == "MixtralForCausalLM":
|
||||
model_class = MixtralForCausalLM
|
||||
break
|
||||
if arch == "QWenLMHeadModel":
|
||||
model_class = QWenLMHeadModel
|
||||
break
|
||||
if model_class is None:
|
||||
raise ValueError(f"Unsupported architectures: {architectures}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user