AirLLMInternLM and AirLLMBaichuan are model-specific subclasses of AirLLMBaseModel that configure InternLM and Baichuan models for streaming inference, with Baichuan using a vendored tokenizer to avoid upstream HuggingFace bugs. These classes inherit shared streaming logic from the base and override only generation config and tokenizer loading to match each model's requirements.
AirLLMInternLM, defined in air_llm/airllm/airllm_internlm.py, is a minimal subclass of AirLLMBaseModel — BetterTransformer is disabled and get_generation_config returns a bare GenerationConfig(), with all streaming logic inherited from the base class.[1]
AirLLMBaichuan imports BaichuanTokenizer from the vendored local module .tokenization_baichuan rather than from transformers, specifically to avoid a known upstream HuggingFace Hub tokenizer bug for Baichuan2.[2] AirLLMBaichuan.get_tokenizer loads that vendored BaichuanTokenizer with use_fast=False and trust_remote_code=True from the local model path, working around the bug tracked in the Baichuan2-7B-Base Hub discussion.[2]
Sources