SYMBOL INDEX (322 symbols across 53 files) FILE: llava/conversation.py class SeparatorStyle (line 9) | class SeparatorStyle(Enum): class Conversation (line 19) | class Conversation: method get_prompt (line 32) | def get_prompt(self): method append_message (line 109) | def append_message(self, role, message): method process_image (line 112) | def process_image(self, image, image_process_mode, return_pil=False, i... method get_images (line 152) | def get_images(self, return_pil=False): method to_gradio_chatbot (line 162) | def to_gradio_chatbot(self): method copy (line 180) | def copy(self): method dict (line 191) | def dict(self): FILE: llava/eval/eval_gpt_review.py function get_eval (line 13) | def get_eval(content: str, max_tokens: int): function parse_score (line 39) | def parse_score(review): FILE: llava/eval/eval_gpt_review_bench.py function get_eval (line 11) | def get_eval(content: str, max_tokens: int): function parse_score (line 36) | def parse_score(review): FILE: llava/eval/eval_gpt_review_visual.py function get_eval (line 11) | def get_eval(content: str, max_tokens: int): function parse_score (line 36) | def parse_score(review): FILE: llava/eval/eval_pope.py function eval_pope (line 5) | def eval_pope(answers, label_file): FILE: llava/eval/eval_science_qa.py function get_args (line 8) | def get_args(): function convert_caps (line 19) | def convert_caps(results): function get_pred_idx (line 28) | def get_pred_idx(prediction, choices, options): FILE: llava/eval/eval_science_qa_gpt4.py function get_args (line 9) | def get_args(): function convert_caps (line 19) | def convert_caps(results): function get_pred_idx (line 28) | def get_pred_idx(prediction, choices, options): FILE: llava/eval/eval_science_qa_gpt4_requery.py function get_args (line 9) | def get_args(): function convert_caps (line 21) | def convert_caps(results): function get_pred_idx (line 30) | def get_pred_idx(prediction, choices, options): FILE: llava/eval/eval_textvqa.py function get_args (line 9) | def get_args(): function prompt_processor (line 17) | def prompt_processor(prompt): function eval_single (line 35) | def eval_single(annotation_file, result_file): FILE: llava/eval/generate_webpage_data_from_table.py function read_jsonl (line 10) | def read_jsonl(path: str, key: str=None): function trim_hanging_lines (line 23) | def trim_hanging_lines(s: str, n: int) -> str: FILE: llava/eval/m4c_evaluator.py class EvalAIAnswerProcessor (line 7) | class EvalAIAnswerProcessor: method __init__ (line 178) | def __init__(self, *args, **kwargs): method word_tokenize (line 181) | def word_tokenize(self, word): method process_punctuation (line 186) | def process_punctuation(self, in_text): method process_digit_article (line 198) | def process_digit_article(self, in_text): method __call__ (line 213) | def __call__(self, item): class TextVQAAccuracyEvaluator (line 221) | class TextVQAAccuracyEvaluator: method __init__ (line 222) | def __init__(self): method _compute_answer_scores (line 225) | def _compute_answer_scores(self, raw_answers): method eval_pred_list (line 248) | def eval_pred_list(self, pred_list): class STVQAAccuracyEvaluator (line 260) | class STVQAAccuracyEvaluator: method __init__ (line 261) | def __init__(self): method eval_pred_list (line 264) | def eval_pred_list(self, pred_list): class STVQAANLSEvaluator (line 276) | class STVQAANLSEvaluator: method __init__ (line 277) | def __init__(self): method get_anls (line 282) | def get_anls(self, s1, s2): method eval_pred_list (line 289) | def eval_pred_list(self, pred_list): class TextCapsBleu4Evaluator (line 301) | class TextCapsBleu4Evaluator: method __init__ (line 302) | def __init__(self): method eval_pred_list (line 321) | def eval_pred_list(self, pred_list): FILE: llava/eval/model_qa.py function eval_model (line 14) | def eval_model(model_name, questions_file, answers_file): FILE: llava/eval/model_vqa.py function split_list (line 18) | def split_list(lst, n): function get_chunk (line 24) | def get_chunk(lst, n, k): function eval_model (line 29) | def eval_model(args): FILE: llava/eval/model_vqa_loader.py function split_list (line 19) | def split_list(lst, n): function get_chunk (line 25) | def get_chunk(lst, n, k): class CustomDataset (line 31) | class CustomDataset(Dataset): method __init__ (line 32) | def __init__(self, questions, image_folder, tokenizer, image_processor... method __getitem__ (line 39) | def __getitem__(self, index): method __len__ (line 60) | def __len__(self): function collate_fn (line 64) | def collate_fn(batch): function create_data_loader (line 72) | def create_data_loader(questions, image_folder, tokenizer, image_process... function eval_model (line 79) | def eval_model(args): FILE: llava/eval/model_vqa_mmbench.py function split_list (line 22) | def split_list(lst, n): function get_chunk (line 28) | def get_chunk(lst, n, k): function is_none (line 33) | def is_none(value): function get_options (line 44) | def get_options(row, options): function eval_model (line 54) | def eval_model(args): FILE: llava/eval/model_vqa_science.py function split_list (line 18) | def split_list(lst, n): function get_chunk (line 24) | def get_chunk(lst, n, k): function eval_model (line 29) | def eval_model(args): FILE: llava/eval/qa_baseline_gpt35.py function get_answer (line 16) | def get_answer(question_id: int, question: str, max_tokens: int): FILE: llava/eval/run_llava.py function image_parser (line 28) | def image_parser(args): function load_image (line 33) | def load_image(image_file): function load_images (line 42) | def load_images(image_files): function eval_model (line 50) | def eval_model(args): FILE: llava/eval/summarize_gpt_review.py function parse_args (line 9) | def parse_args(): FILE: llava/eval/webpage/script.js function text2Markdown (line 35) | function text2Markdown(text) { function capitalizeFirstChar (line 41) | function capitalizeFirstChar(str) { function updateQuestionSelect (line 48) | function updateQuestionSelect(question_id) { function updateModelSelect (line 64) | function updateModelSelect() { function populateModels (line 70) | function populateModels(models) { function populateQuestions (line 81) | function populateQuestions(questions) { function displayQuestion (line 110) | function displayQuestion(index) { function displayAnswers (line 116) | function displayAnswers(index) { function switchQuestionAndCategory (line 203) | function switchQuestionAndCategory() { function updateExpandButtonVisibility (line 226) | function updateExpandButtonVisibility(card) { FILE: llava/mm_utils.py function select_best_resolution (line 12) | def select_best_resolution(original_size, possible_resolutions): function resize_and_pad_image (line 42) | def resize_and_pad_image(image, target_resolution): function divide_to_patches (line 77) | def divide_to_patches(image, patch_size): function get_anyres_image_grid_shape (line 99) | def get_anyres_image_grid_shape(image_size, grid_pinpoints, patch_size): function process_anyres_image (line 119) | def process_anyres_image(image, processor, grid_pinpoints): function load_image_from_base64 (line 148) | def load_image_from_base64(image): function expand2square (line 152) | def expand2square(pil_img, background_color): function process_images (line 166) | def process_images(images, image_processor, model_cfg): function tokenizer_image_token (line 185) | def tokenizer_image_token(prompt, tokenizer, image_token_index=IMAGE_TOK... function get_model_name_from_path (line 207) | def get_model_name_from_path(model_path): class KeywordsStoppingCriteria (line 215) | class KeywordsStoppingCriteria(StoppingCriteria): method __init__ (line 216) | def __init__(self, keywords, tokenizer, input_ids): method call_for_batch (line 230) | def call_for_batch(self, output_ids: torch.LongTensor, scores: torch.F... method __call__ (line 243) | def __call__(self, output_ids: torch.LongTensor, scores: torch.FloatTe... FILE: llava/model/apply_delta.py function apply_delta (line 13) | def apply_delta(base_model_path, target_model_path, delta_path): FILE: llava/model/builder.py function load_pretrained_model (line 26) | def load_pretrained_model(model_path, model_base, model_name, load_8bit=... FILE: llava/model/consolidate.py function consolidate_ckpt (line 13) | def consolidate_ckpt(src_path, dst_path): FILE: llava/model/language_model/llava_llama.py class LlavaConfig (line 30) | class LlavaConfig(LlamaConfig): class LlavaLlamaModel (line 34) | class LlavaLlamaModel(LlavaMetaModel, LlamaModel): method __init__ (line 37) | def __init__(self, config: LlamaConfig): class LlavaLlamaForCausalLM (line 41) | class LlavaLlamaForCausalLM(LlamaForCausalLM, LlavaMetaForCausalLM): method __init__ (line 44) | def __init__(self, config): method get_model (line 54) | def get_model(self): method forward (line 57) | def forward( method generate (line 105) | def generate( method prepare_inputs_for_generation (line 144) | def prepare_inputs_for_generation(self, input_ids, past_key_values=None, FILE: llava/model/language_model/llava_mistral.py class LlavaMistralConfig (line 31) | class LlavaMistralConfig(MistralConfig): class LlavaMistralModel (line 35) | class LlavaMistralModel(LlavaMetaModel, MistralModel): method __init__ (line 38) | def __init__(self, config: MistralConfig): class LlavaMistralForCausalLM (line 42) | class LlavaMistralForCausalLM(MistralForCausalLM, LlavaMetaForCausalLM): method __init__ (line 45) | def __init__(self, config): method get_model (line 54) | def get_model(self): method forward (line 57) | def forward( method generate (line 105) | def generate( method prepare_inputs_for_generation (line 144) | def prepare_inputs_for_generation(self, input_ids, past_key_values=None, FILE: llava/model/language_model/llava_mpt.py class LlavaMptConfig (line 25) | class LlavaMptConfig(MptConfig): class LlavaMptModel (line 29) | class LlavaMptModel(LlavaMetaModel, MptModel): method __init__ (line 32) | def __init__(self, config: MptConfig): method embed_tokens (line 36) | def embed_tokens(self, x): class LlavaMptForCausalLM (line 40) | class LlavaMptForCausalLM(MptForCausalLM, LlavaMetaForCausalLM): method __init__ (line 44) | def __init__(self, config): method get_model (line 53) | def get_model(self): method _set_gradient_checkpointing (line 56) | def _set_gradient_checkpointing(self, module, value=False): method forward (line 60) | def forward( method prepare_inputs_for_generation (line 87) | def prepare_inputs_for_generation(self, input_ids, past_key_values=Non... FILE: llava/model/llava_arch.py class LlavaMetaModel (line 29) | class LlavaMetaModel: method __init__ (line 31) | def __init__(self, config): method get_vision_tower (line 43) | def get_vision_tower(self): method initialize_vision_modules (line 49) | def initialize_vision_modules(self, model_args, fsdp=None): function unpad_image (line 100) | def unpad_image(tensor, original_size): class LlavaMetaForCausalLM (line 131) | class LlavaMetaForCausalLM(ABC): method get_model (line 134) | def get_model(self): method get_vision_tower (line 137) | def get_vision_tower(self): method encode_images (line 140) | def encode_images(self, images): method prepare_inputs_labels_for_multimodal (line 145) | def prepare_inputs_labels_for_multimodal( method initialize_vision_tokenizer (line 326) | def initialize_vision_tokenizer(self, model_args, tokenizer): FILE: llava/model/make_delta.py function make_delta (line 13) | def make_delta(base_model_path, target_model_path, delta_path, hub_repo_... FILE: llava/model/multimodal_encoder/builder.py function build_vision_tower (line 5) | def build_vision_tower(vision_tower_cfg, **kwargs): FILE: llava/model/multimodal_encoder/clip_encoder.py class CLIPVisionTower (line 7) | class CLIPVisionTower(nn.Module): method __init__ (line 8) | def __init__(self, vision_tower, args, delay_load=False): method load_model (line 24) | def load_model(self, device_map=None): method feature_select (line 35) | def feature_select(self, image_forward_outs): method forward (line 46) | def forward(self, images): method dummy_feature (line 60) | def dummy_feature(self): method dtype (line 64) | def dtype(self): method device (line 68) | def device(self): method config (line 72) | def config(self): method hidden_size (line 79) | def hidden_size(self): method num_patches_per_side (line 83) | def num_patches_per_side(self): method num_patches (line 87) | def num_patches(self): class CLIPVisionTowerS2 (line 92) | class CLIPVisionTowerS2(CLIPVisionTower): method __init__ (line 93) | def __init__(self, vision_tower, args, delay_load=False): method load_model (line 113) | def load_model(self, device_map=None): method forward_feature (line 128) | def forward_feature(self, images): method forward (line 134) | def forward(self, images): method hidden_size (line 146) | def hidden_size(self): FILE: 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 28) | def forward(self, x): function build_vision_projector (line 33) | def build_vision_projector(config, delay_load=False, **kwargs): FILE: llava/model/utils.py function auto_upgrade (line 4) | def auto_upgrade(config): FILE: llava/serve/cli.py function load_image (line 18) | def load_image(image_file): function main (line 27) | def main(args): FILE: llava/serve/controller.py class DispatchMethod (line 28) | class DispatchMethod(Enum): method from_str (line 33) | def from_str(cls, name): class WorkerInfo (line 43) | class WorkerInfo: function heart_beat_controller (line 51) | def heart_beat_controller(controller): class Controller (line 57) | class Controller: method __init__ (line 58) | def __init__(self, dispatch_method: str): method register_worker (line 69) | def register_worker(self, worker_name: str, check_heart_beat: bool, method get_worker_status (line 88) | def get_worker_status(self, worker_name: str): method remove_worker (line 101) | def remove_worker(self, worker_name: str): method refresh_all_workers (line 104) | def refresh_all_workers(self): method list_models (line 112) | def list_models(self): method get_worker_address (line 120) | def get_worker_address(self, model_name: str): method receive_heart_beat (line 173) | def receive_heart_beat(self, worker_name: str, queue_length: int): method remove_stable_workers_by_expiration (line 183) | def remove_stable_workers_by_expiration(self): method worker_api_generate_stream (line 193) | def worker_api_generate_stream(self, params): method worker_api_get_status (line 220) | def worker_api_get_status(self): function register_worker (line 243) | async def register_worker(request: Request): function refresh_all_workers (line 251) | async def refresh_all_workers(): function list_models (line 256) | async def list_models(): function get_worker_address (line 262) | async def get_worker_address(request: Request): function receive_heart_beat (line 269) | async def receive_heart_beat(request: Request): function worker_api_generate_stream (line 277) | async def worker_api_generate_stream(request: Request): function worker_api_get_status (line 284) | async def worker_api_get_status(request: Request): FILE: llava/serve/gradio_web_server.py function get_conv_log_filename (line 32) | def get_conv_log_filename(): function get_model_list (line 38) | def get_model_list(): function load_demo (line 58) | def load_demo(url_params, request: gr.Request): function load_demo_refresh_model_list (line 71) | def load_demo_refresh_model_list(request: gr.Request): function vote_last_response (line 82) | def vote_last_response(state, vote_type, model_selector, request: gr.Req... function upvote_last_response (line 94) | def upvote_last_response(state, model_selector, request: gr.Request): function downvote_last_response (line 100) | def downvote_last_response(state, model_selector, request: gr.Request): function flag_last_response (line 106) | def flag_last_response(state, model_selector, request: gr.Request): function regenerate (line 112) | def regenerate(state, image_process_mode, request: gr.Request): function clear_history (line 122) | def clear_history(request: gr.Request): function add_text (line 128) | def add_text(state, text, image, image_process_mode, request: gr.Request): function http_bot (line 154) | def http_bot(state, model_selector, temperature, top_p, max_new_tokens, ... function build_demo (line 315) | def build_demo(embed_mode, cur_dir=None, concurrency_count=10): FILE: llava/serve/model_worker.py function heart_beat_worker (line 37) | def heart_beat_worker(controller): class ModelWorker (line 44) | class ModelWorker: method __init__ (line 45) | def __init__(self, controller_addr, worker_addr, method register_to_controller (line 75) | def register_to_controller(self): method send_heart_beat (line 87) | def send_heart_beat(self): method get_queue_length (line 108) | def get_queue_length(self): method get_status (line 115) | def get_status(self): method generate_stream (line 123) | def generate_stream(self, params): method generate_stream_gate (line 195) | def generate_stream_gate(self, params): function release_model_semaphore (line 225) | def release_model_semaphore(fn=None): function generate_stream (line 232) | async def generate_stream(request: Request): function get_status (line 248) | async def get_status(request: Request): FILE: llava/serve/sglang_worker.py function heart_beat_worker (line 38) | def heart_beat_worker(controller): function pipeline (line 45) | def pipeline(s, prompt, max_tokens): class ModelWorker (line 54) | class ModelWorker: method __init__ (line 55) | def __init__(self, controller_addr, worker_addr, sgl_endpoint, method register_to_controller (line 85) | def register_to_controller(self): method send_heart_beat (line 97) | def send_heart_beat(self): method get_queue_length (line 118) | def get_queue_length(self): method get_status (line 125) | def get_status(self): method generate_stream (line 132) | async def generate_stream(self, params): method generate_stream_gate (line 172) | async def generate_stream_gate(self, params): function release_model_semaphore (line 195) | def release_model_semaphore(fn=None): function generate_stream (line 202) | async def generate_stream(request: Request): function get_status (line 218) | async def get_status(request: Request): FILE: llava/serve/test_message.py function main (line 9) | def main(): FILE: llava/train/llama_flash_attn_monkey_patch.py function forward (line 16) | def forward( function _prepare_decoder_attention_mask (line 98) | def _prepare_decoder_attention_mask( function replace_llama_attn_with_flash_attn (line 105) | def replace_llama_attn_with_flash_attn(): FILE: llava/train/llama_xformers_attn_monkey_patch.py function replace_llama_attn_with_xformers_attn (line 19) | def replace_llama_attn_with_xformers_attn(): function xformers_forward (line 23) | def xformers_forward( FILE: llava/train/llava_trainer.py function maybe_zero_3 (line 18) | def maybe_zero_3(param, ignore_status=False, name=None): function get_mm_adapter_state_maybe_zero_3 (line 32) | def get_mm_adapter_state_maybe_zero_3(named_params, keys_to_match): function split_to_even_chunks (line 38) | def split_to_even_chunks(indices, lengths, num_chunks): function get_modality_length_grouped_indices (line 60) | def get_modality_length_grouped_indices(lengths, batch_size, world_size,... function get_length_grouped_indices (line 88) | def get_length_grouped_indices(lengths, batch_size, world_size, generato... class LengthGroupedSampler (line 99) | class LengthGroupedSampler(Sampler): method __init__ (line 105) | def __init__( method __len__ (line 122) | def __len__(self): method __iter__ (line 125) | def __iter__(self): class LLaVATrainer (line 133) | class LLaVATrainer(Trainer): method _get_train_sampler (line 135) | def _get_train_sampler(self) -> Optional[torch.utils.data.Sampler]: method create_optimizer (line 150) | def create_optimizer(self): method _save_checkpoint (line 230) | def _save_checkpoint(self, model, trial, metrics=None): method _save (line 251) | def _save(self, output_dir: Optional[str] = None, state_dict=None): FILE: llava/train/train.py function rank0_print (line 44) | def rank0_print(*args): class ModelArguments (line 54) | class ModelArguments: class DataArguments (line 70) | class DataArguments: class TrainingArguments (line 80) | class TrainingArguments(transformers.TrainingArguments): function maybe_zero_3 (line 115) | def maybe_zero_3(param, ignore_status=False, name=None): function get_peft_state_maybe_zero_3 (line 130) | def get_peft_state_maybe_zero_3(named_params, bias): function get_peft_state_non_lora_maybe_zero_3 (line 155) | def get_peft_state_non_lora_maybe_zero_3(named_params, require_grad_only... function get_mm_adapter_state_maybe_zero_3 (line 163) | def get_mm_adapter_state_maybe_zero_3(named_params, keys_to_match): function find_all_linear_names (line 169) | def find_all_linear_names(model): function safe_save_model_for_hf_trainer (line 185) | def safe_save_model_for_hf_trainer(trainer: transformers.Trainer, function smart_tokenizer_and_embedding_resize (line 224) | def smart_tokenizer_and_embedding_resize( function _tokenize_fn (line 249) | def _tokenize_fn(strings: Sequence[str], function _mask_targets (line 276) | def _mask_targets(target, tokenized_lens, speakers): function _add_speaker_and_signal (line 287) | def _add_speaker_and_signal(header, source, get_conversation=True): function preprocess_multimodal (line 308) | def preprocess_multimodal( function preprocess_llama_2 (line 332) | def preprocess_llama_2( function preprocess_v1 (line 414) | def preprocess_v1( function preprocess_mpt (line 500) | def preprocess_mpt( function preprocess_plain (line 588) | def preprocess_plain( function preprocess (line 610) | def preprocess( class LazySupervisedDataset (line 658) | class LazySupervisedDataset(Dataset): method __init__ (line 661) | def __init__(self, data_path: str, method __len__ (line 672) | def __len__(self): method lengths (line 676) | def lengths(self): method modality_lengths (line 684) | def modality_lengths(self): method __getitem__ (line 692) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: class DataCollatorForSupervisedDataset (line 743) | class DataCollatorForSupervisedDataset(object): method __call__ (line 748) | def __call__(self, instances: Sequence[Dict]) -> Dict[str, torch.Tensor]: function make_supervised_data_module (line 776) | def make_supervised_data_module(tokenizer: transformers.PreTrainedTokeni... function train (line 788) | def train(attn_implementation=None): FILE: llava/utils.py function build_logger (line 17) | def build_logger(logger_name, logger_filename): class StreamToLogger (line 60) | class StreamToLogger(object): method __init__ (line 64) | def __init__(self, logger, log_level=logging.INFO): method __getattr__ (line 70) | def __getattr__(self, attr): method write (line 73) | def write(self, buf): method flush (line 87) | def flush(self): function disable_torch_init (line 93) | def disable_torch_init(): function violates_moderation (line 102) | def violates_moderation(text): function pretty_print_semaphore (line 123) | def pretty_print_semaphore(semaphore): FILE: predict.py function download_json (line 54) | def download_json(url: str, dest: Path): function download_weights (line 62) | def download_weights(baseurl: str, basedest: str, files: list[str]): class Predictor (line 78) | class Predictor(BasePredictor): method setup (line 79) | def setup(self) -> None: method predict (line 87) | def predict( function load_image (line 148) | def load_image(image_file): FILE: scripts/convert_mmbench_for_submission.py function get_args (line 6) | def get_args(): FILE: scripts/convert_seed_for_submission.py function get_args (line 6) | def get_args(): function eval_single (line 14) | def eval_single(result_file, eval_only_type=None): FILE: scripts/convert_sqa_to_llava.py function convert_to_llava (line 8) | def convert_to_llava(base_dir, split, prompt_format="QCM-LEA"): function convert_to_jsonl (line 49) | def convert_to_jsonl(base_dir, split, prompt_format="QCM-LEPA"): function main (line 83) | def main(task, **kwargs): FILE: scripts/convert_sqa_to_llava_base_prompt.py function get_question_text (line 1) | def get_question_text(problem): function get_context_text (line 6) | def get_context_text(problem, use_caption): function get_choice_text (line 15) | def get_choice_text(probelm, options): function get_answer (line 25) | def get_answer(problem, options): function get_lecture_text (line 29) | def get_lecture_text(problem): function get_solution_text (line 35) | def get_solution_text(problem): function create_one_example_chatbot (line 41) | def create_one_example_chatbot(format, question, context, choice, answer... function create_one_example (line 106) | def create_one_example(format, question, context, choice, answer, lectur... function create_one_example_gpt4 (line 162) | def create_one_example_gpt4(format, question, context, choice, answer, l... function build_prompt_chatbot (line 221) | def build_prompt_chatbot(problems, shot_qids, prompt_format, use_caption... function build_prompt (line 244) | def build_prompt(problems, shot_qids, test_qid, args): function build_prompt_gpt4 (line 291) | def build_prompt_gpt4(problems, shot_qids, test_qid, args): FILE: scripts/convert_vizwiz_for_submission.py function parse_args (line 8) | def parse_args(): FILE: scripts/convert_vqav2_for_submission.py function parse_args (line 8) | def parse_args(): FILE: scripts/extract_mm_projector.py function parse_args (line 15) | def parse_args(): FILE: scripts/merge_lora_weights.py function merge_lora (line 6) | def merge_lora(args):