Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
rickzx committed Apr 29, 2024
1 parent e335fc1 commit 14e5fc5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions python/mlc_llm/embeddings/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ def __init__( # pylint: disable=too-many-arguments
device: Optional[str] = "auto",
debug_dir: Optional[str] = None,
):

self.device = detect_device(device)
instrument = DefaultDebugInstrument(Path(debug_dir)) if debug_dir else None
self.mod, self.params, self.metadata = _get_tvm_module(
Expand Down Expand Up @@ -169,7 +168,7 @@ def embed(self, queries: List[str]) -> tvm.runtime.NDArray:
return output

def _tokenize_queries(self, queries: List[str]) -> Tuple[np.ndarray, np.ndarray]:
tokens = engine_utils.process_prompts(queries, self.tokenizer.encode)
tokens = engine_utils.process_prompts(queries, self.tokenizer.encode) # type: ignore
max_query_length = max(len(token_seq) for token_seq in tokens)

token_inputs = np.zeros((len(tokens), max_query_length), dtype=np.int32)
Expand Down
4 changes: 2 additions & 2 deletions python/mlc_llm/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from mlc_llm.quantization.quantization import Quantization

from .baichuan import baichuan_loader, baichuan_model, baichuan_quantization
from .bert import bert_loader, bert_model, bert_quantization
from .chatglm3 import chatglm3_loader, chatglm3_model, chatglm3_quantization
from .eagle import eagle_loader, eagle_model, eagle_quantization
from .gemma import gemma_loader, gemma_model, gemma_quantization
Expand All @@ -27,7 +28,6 @@
from .rwkv5 import rwkv5_loader, rwkv5_model, rwkv5_quantization
from .rwkv6 import rwkv6_loader, rwkv6_model, rwkv6_quantization
from .stable_lm import stablelm_loader, stablelm_model, stablelm_quantization
from .bert import bert_loader, bert_model, bert_quantization

ModelConfig = Any
"""A ModelConfig is an object that represents a model architecture. It is required to have
Expand Down Expand Up @@ -369,5 +369,5 @@ class Model:
"group-quant": bert_quantization.group_quant,
"ft-quant": bert_quantization.ft_quant,
},
)
),
}
4 changes: 2 additions & 2 deletions python/mlc_llm/model/model_preset.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,6 @@
"position_embedding_type": "absolute",
"transformers_version": "4.6.0.dev0",
"type_vocab_size": 2,
"vocab_size": 30522
}
"vocab_size": 30522,
},
}

0 comments on commit 14e5fc5

Please sign in to comment.