SYMBOL INDEX (204 symbols across 27 files) FILE: VL/cli.py function load_image (line 17) | def load_image(image_file): function main (line 22) | def main(args): FILE: VL/llava/conversation.py class SeparatorStyle (line 6) | class SeparatorStyle(Enum): class Conversation (line 13) | class Conversation: method get_prompt (line 27) | def get_prompt(self): method append_message (line 56) | def append_message(self, role, message): method get_images (line 59) | def get_images(self, return_pil=False): method to_gradio_chatbot (line 118) | def to_gradio_chatbot(self): method copy (line 150) | def copy(self): method dict (line 162) | def dict(self): FILE: VL/llava/mm_utils.py function load_image_from_base64 (line 11) | def load_image_from_base64(image): function process_images (line 15) | def process_images(images, image_processor, model_cfg): function expand2square (line 19) | def expand2square(pil_img, background_color): function tokenizer_image_token (line 33) | def tokenizer_image_token( function get_model_name_from_path (line 63) | def get_model_name_from_path(model_path): function load_pretrained_model (line 72) | def load_pretrained_model( class KeywordsStoppingCriteria (line 99) | class KeywordsStoppingCriteria(StoppingCriteria): method __init__ (line 100) | def __init__(self, keywords, tokenizer, input_ids): method __call__ (line 106) | def __call__( FILE: VL/llava/model/clip_encoder/builder.py function build_vision_tower (line 4) | def build_vision_tower(vision_tower_cfg, **kwargs): FILE: VL/llava/model/clip_encoder/clip_encoder.py class CLIPVisionTower (line 6) | class CLIPVisionTower(nn.Module): method __init__ (line 7) | def __init__(self, vision_tower, args, delay_load=False): method load_model (line 21) | def load_model(self): method feature_select (line 31) | def feature_select(self, image_forward_outs): method forward (line 42) | def forward(self, images): method dummy_feature (line 62) | def dummy_feature(self): method dtype (line 66) | def dtype(self): method device (line 70) | def device(self): method config (line 74) | def config(self): method hidden_size (line 81) | def hidden_size(self): method num_patches (line 85) | def num_patches(self): FILE: VL/llava/model/llava_arch.py class LlavaMetaModel (line 26) | class LlavaMetaModel: method __init__ (line 27) | def __init__(self, config): method get_vision_tower (line 37) | def get_vision_tower(self): method initialize_vision_modules (line 43) | def initialize_vision_modules(self, model_args): class LlavaMetaForCausalLM (line 87) | class LlavaMetaForCausalLM(ABC): method get_model (line 89) | def get_model(self): method get_vision_tower (line 92) | def get_vision_tower(self): method encode_images (line 95) | def encode_images(self, images): method prepare_inputs_labels_for_multimodal (line 100) | def prepare_inputs_labels_for_multimodal( method initialize_vision_tokenizer (line 333) | def initialize_vision_tokenizer(self, model_args, tokenizer): FILE: VL/llava/model/llava_llama.py class LlavaConfig (line 27) | class LlavaConfig(LlamaConfig): class LlavaLlamaModel (line 31) | class LlavaLlamaModel(LlavaMetaModel, LlamaModel): method __init__ (line 34) | def __init__(self, config: LlamaConfig): class LlavaLlamaForCausalLM (line 39) | class LlavaLlamaForCausalLM(LlamaForCausalLM, LlavaMetaForCausalLM): method __init__ (line 42) | def __init__(self, config): method get_model (line 51) | def get_model(self): method forward (line 54) | def forward( method prepare_inputs_for_generation (line 137) | def prepare_inputs_for_generation( FILE: VL/llava/model/multimodal_projector/builder.py class IdentityMap (line 6) | class IdentityMap(nn.Module): method __init__ (line 7) | def __init__(self): method forward (line 10) | def forward(self, x, *args, **kwargs): method config (line 14) | def config(self): class SimpleResBlock (line 18) | class SimpleResBlock(nn.Module): method __init__ (line 19) | def __init__(self, channels): method forward (line 27) | def forward(self, x): function build_vision_projector (line 32) | def build_vision_projector(config, delay_load=False, **kwargs): FILE: VL/openai_api.py class Role (line 66) | class Role(str, Enum): class ErrorResponse (line 74) | class ErrorResponse(BaseModel): class ErrorCode (line 80) | class ErrorCode(IntEnum): class ChatCompletionCreateParams (line 107) | class ChatCompletionCreateParams(BaseModel): function torch_gc (line 266) | def torch_gc() -> None: function lifespan (line 277) | async def lifespan(app: FastAPI): # collects GPU memory function create_chat_completion (line 294) | async def create_chat_completion( function generate_stream (line 341) | def generate_stream( class DefaultEngine (line 442) | class DefaultEngine(ABC): method __init__ (line 445) | def __init__( method _prepare_for_generate (line 472) | def _prepare_for_generate(self) -> None: method convert_to_inputs (line 485) | def convert_to_inputs( method _generate (line 552) | def _generate(self, params: Dict[str, Any]) -> Iterator[dict]: method _create_chat_completion_stream (line 590) | def _create_chat_completion_stream( method _create_chat_completion (line 660) | def _create_chat_completion( method create_chat_completion (line 702) | def create_chat_completion( method stop (line 716) | def stop(self): class YiAITemplate (line 726) | class YiAITemplate(ABC): method apply_chat_template (line 743) | def apply_chat_template( method template (line 769) | def template(self) -> str: method postprocess_messages (line 779) | def postprocess_messages( method parse_assistant_response (line 784) | def parse_assistant_response( function _compile_jinja_template (line 791) | def _compile_jinja_template(chat_template: str): function handle_request (line 816) | async def handle_request( function check_requests (line 843) | def check_requests( function create_error_response (line 886) | def create_error_response(code: int, message: str) -> JSONResponse: function get_event_publisher (line 892) | async def get_event_publisher( function create_generate_model (line 920) | def create_generate_model(args): function model_json (line 939) | def model_json(model: pydantic.BaseModel, **kwargs) -> str: function model_dump (line 945) | def model_dump(model: pydantic.BaseModel, **kwargs) -> Dict[str, Any]: function model_parse (line 954) | def model_parse(model: Type[pydantic.BaseModel], data: Any) -> pydantic.... function get_context_length (line 973) | def get_context_length(config) -> int: function apply_stopping_strings (line 984) | def apply_stopping_strings(reply: str, stop_strings: List[str]) -> Tuple... function _get_args (line 1016) | def _get_args(): FILE: VL/single_inference.py function disable_torch_init (line 17) | def disable_torch_init(): function single_infer (line 27) | def single_infer(args): FILE: VL/web_demo.py function load_model_tokenizer_processor (line 24) | def load_model_tokenizer_processor(args): function _parse_text (line 33) | def _parse_text(text): function launch_demo (line 84) | def launch_demo(args, yi_model, tokenizer, image_processor): function main (line 294) | def main(args): FILE: demo/text_generation.py function parse_inputs (line 6) | def parse_inputs(): function main (line 36) | def main(args): FILE: demo/text_generation_tp.py function parse_inputs (line 11) | def parse_inputs(): function main (line 54) | def main(args): FILE: demo/web_demo.py class StopOnTokens (line 17) | class StopOnTokens(StoppingCriteria): method __call__ (line 18) | def __call__( function parse_text (line 30) | def parse_text(text): function predict (line 62) | def predict(history, max_length, top_p, temperature): function main (line 100) | def main(args): FILE: finetune/sft/main.py function parse_args (line 45) | def parse_args(): function main (line 220) | def main(): FILE: finetune/sft/prompt_eval.py function parse_args (line 18) | def parse_args(): function generate (line 78) | def generate( function print_utils (line 102) | def print_utils(gen_output): function prompt_eval (line 109) | def prompt_eval(args, model_baseline, model_fintuned, tokenizer, device,... function main (line 139) | def main(): FILE: finetune/utils/data/data_utils.py function get_raw_dataset (line 20) | def get_raw_dataset(dataset_name, output_path, seed, local_rank): function get_shuffle_idx (line 67) | def get_shuffle_idx(seed, size): function get_raw_dataset_split_index (line 77) | def get_raw_dataset_split_index( class PromptDataset (line 114) | class PromptDataset(Dataset): method __init__ (line 115) | def __init__( method __len__ (line 125) | def __len__(self): method __getitem__ (line 129) | def __getitem__(self, idx): function create_dataset_split (line 138) | def create_dataset_split( function create_dataset (line 184) | def create_dataset( function create_prompt_dataset (line 248) | def create_prompt_dataset( class DataCollatorReward (line 359) | class DataCollatorReward: method __call__ (line 360) | def __call__(self, data): class DataCollatorRLHF (line 371) | class DataCollatorRLHF: method __init__ (line 372) | def __init__(self, max_token_len, inference_tp_size): method __call__ (line 376) | def __call__(self, data): function get_unsupervised_data (line 405) | def get_unsupervised_data(args, tokenizer): class MiniDataset (line 455) | class MiniDataset: method __init__ (line 456) | def __init__(self, max_size, small_batch_size): method seperate (line 461) | def seperate(self): method add (line 488) | def add(self, data): method free (line 500) | def free(self): FILE: finetune/utils/data/raw_datasets.py class PromptRawDataset (line 7) | class PromptRawDataset(object): method __init__ (line 8) | def __init__(self, output_path, seed, local_rank, dataset_name): method get_train_data (line 14) | def get_train_data(self): method get_eval_data (line 17) | def get_eval_data(self): method get_prompt (line 21) | def get_prompt(self, sample): method get_chosen (line 25) | def get_chosen(self, sample): method get_rejected (line 30) | def get_rejected(self, sample): method get_prompt_and_chosen (line 33) | def get_prompt_and_chosen(self, sample): method get_prompt_and_rejected (line 36) | def get_prompt_and_rejected(self, sample): class DahoasRmstaticDataset (line 41) | class DahoasRmstaticDataset(PromptRawDataset): method __init__ (line 42) | def __init__(self, output_path, seed, local_rank, dataset_name): method get_train_data (line 59) | def get_train_data(self): method get_eval_data (line 62) | def get_eval_data(self): method get_prompt (line 65) | def get_prompt(self, sample): method get_chosen (line 68) | def get_chosen(self, sample): method get_rejected (line 71) | def get_rejected(self, sample): method get_prompt_and_chosen (line 74) | def get_prompt_and_chosen(self, sample): method get_prompt_and_rejected (line 77) | def get_prompt_and_rejected(self, sample): class LocalJsonFileDataset (line 81) | class LocalJsonFileDataset(PromptRawDataset): method __init__ (line 82) | def __init__(self, output_path, seed, local_rank, dataset_name, chat_p... method get_train_data (line 94) | def get_train_data(self): method get_eval_data (line 99) | def get_eval_data(self): method get_prompt (line 105) | def get_prompt(self, sample): method get_chosen (line 111) | def get_chosen(self, sample): method get_rejected (line 118) | def get_rejected(self, sample): method get_prompt_and_chosen (line 123) | def get_prompt_and_chosen(self, sample): method get_prompt_and_rejected (line 128) | def get_prompt_and_rejected(self, sample): class YiDataset (line 134) | class YiDataset(PromptRawDataset): method __init__ (line 135) | def __init__(self, output_path, seed, local_rank, dataset_name, chat_p... method get_train_data (line 148) | def get_train_data(self): method get_eval_data (line 153) | def get_eval_data(self): method get_prompt (line 158) | def get_prompt(self, sample): method get_prompt_and_chosen (line 163) | def get_prompt_and_chosen(self, sample): FILE: finetune/utils/ds_utils.py function get_train_ds_config (line 8) | def get_train_ds_config( function get_eval_ds_config (line 61) | def get_eval_ds_config(offload, stage=0): FILE: finetune/utils/model/model_utils.py function create_hf_model (line 7) | def create_hf_model( FILE: finetune/utils/module/lora.py class LinearLayer_LoRA (line 10) | class LinearLayer_LoRA(nn.Module): method __init__ (line 13) | def __init__(self, weight, lora_dim=0, lora_scaling=1, lora_droppout=0... method eval (line 45) | def eval(self): method train (line 50) | def train(self, mode=True): method reset_parameters (line 54) | def reset_parameters(self): method fuse_lora_weight (line 58) | def fuse_lora_weight(self): method unfuse_lora_weight (line 65) | def unfuse_lora_weight(self): method forward (line 72) | def forward(self, input): function convert_linear_layer_to_lora (line 88) | def convert_linear_layer_to_lora( function _z3_params_to_fetch (line 108) | def _z3_params_to_fetch(param_list): function convert_lora_to_linear_layer (line 119) | def convert_lora_to_linear_layer(model): function only_optimize_lora_parameters (line 143) | def only_optimize_lora_parameters(model): function make_model_gradient_checkpointing_compatible (line 153) | def make_model_gradient_checkpointing_compatible(model): FILE: finetune/utils/perf.py function print_throughput (line 5) | def print_throughput(hf_model, args, e2e_time, rank=0): function calculate_flops (line 45) | def calculate_flops(checkpoint_activations_factor, batch_size, seq_lengt... function get_hf_configs (line 63) | def get_hf_configs(hf_config): FILE: finetune/utils/utils.py function print_rank_0 (line 11) | def print_rank_0(msg, rank=0): function to_device (line 16) | def to_device(batch, device): class MovingAverage (line 27) | class MovingAverage: method __init__ (line 28) | def __init__(self): method update (line 33) | def update(self, num): function get_tokenizer (line 41) | def get_tokenizer(model_name_or_path, fast_tokenizer=False): function load_hf_tokenizer (line 51) | def load_hf_tokenizer(model_name_or_path, fast_tokenizer=False): function save_hf_format (line 68) | def save_hf_format(model, tokenizer, args, sub_folder=""): function get_all_reduce_mean (line 93) | def get_all_reduce_mean(tensor): function load_state_dict_into_model (line 102) | def load_state_dict_into_model( function get_optimizer_grouped_parameters (line 156) | def get_optimizer_grouped_parameters( function _z3_params_to_fetch (line 203) | def _z3_params_to_fetch(param_list): function moving_average (line 211) | def moving_average(model, model_ema, beta=0.992, device=None, zero_stage... function save_zero_three_model (line 229) | def save_zero_three_model(model_ema, global_rank, save_dir, zero_stage=0): FILE: quantization/awq/eval_quantized_model.py function run_quantization (line 5) | def run_quantization(args): FILE: quantization/awq/quant_autoawq.py function run_quantization (line 8) | def run_quantization(args): FILE: quantization/gptq/eval_quantized_model.py function run_quantization (line 4) | def run_quantization(args): FILE: quantization/gptq/quant_autogptq.py function run_quantization (line 7) | def run_quantization(args):