SYMBOL INDEX (774 symbols across 61 files) FILE: demo.py function parse_args (line 15) | def parse_args(): FILE: demo_gradio.py function parse_args (line 18) | def parse_args(): function gradio_reset (line 57) | def gradio_reset(chat_state, img_list): function upload_video (line 65) | def upload_video(gr_video, chat_state, num_segments, text_prompt='Watch ... function gradio_ask (line 73) | def gradio_ask(user_message, chatbot, chat_state, gr_video, num_segments): function gradio_answer (line 85) | def gradio_answer(chatbot, chat_state, img_list, num_beams, temperature): class STLLM (line 94) | class STLLM(gr.themes.base.Base): method __init__ (line 95) | def __init__( FILE: stllm/common/config.py class Config (line 16) | class Config: method __init__ (line 17) | def __init__(self, args): method _validate_runner_config (line 43) | def _validate_runner_config(self, runner_config): method _build_opt_list (line 52) | def _build_opt_list(self, opts): method build_model_config (line 57) | def build_model_config(config, **kwargs): method build_runner_config (line 84) | def build_runner_config(config): method build_dataset_config (line 88) | def build_dataset_config(config): method _convert_to_dot_list (line 117) | def _convert_to_dot_list(self, opts): method get_config (line 131) | def get_config(self): method run_cfg (line 135) | def run_cfg(self): method datasets_cfg (line 139) | def datasets_cfg(self): method model_cfg (line 143) | def model_cfg(self): method pretty_print (line 146) | def pretty_print(self): method _convert_node_to_json (line 164) | def _convert_node_to_json(self, node): method to_dict (line 168) | def to_dict(self): function node_to_dict (line 172) | def node_to_dict(node): class ConfigValidator (line 176) | class ConfigValidator: class _Argument (line 190) | class _Argument: method __init__ (line 191) | def __init__(self, name, choices=None, type=None, help=None): method __str__ (line 198) | def __str__(self): method __init__ (line 208) | def __init__(self, description): method __getitem__ (line 215) | def __getitem__(self, key): method __str__ (line 220) | def __str__(self) -> str: method add_argument (line 223) | def add_argument(self, *args, **kwargs): method validate (line 229) | def validate(self, config=None): method format_arguments (line 251) | def format_arguments(self): method format_help (line 254) | def format_help(self): method print_help (line 259) | def print_help(self): function create_runner_config_validator (line 264) | def create_runner_config_validator(): FILE: stllm/common/dist_utils.py function setup_for_distributed (line 17) | def setup_for_distributed(is_master): function is_dist_avail_and_initialized (line 33) | def is_dist_avail_and_initialized(): function get_world_size (line 41) | def get_world_size(): function get_rank (line 47) | def get_rank(): function is_main_process (line 53) | def is_main_process(): function init_distributed_mode (line 57) | def init_distributed_mode(args): function get_dist_info (line 96) | def get_dist_info(): function main_process (line 110) | def main_process(func): function download_cached_file (line 120) | def download_cached_file(url, check_hash=True, progress=False): FILE: stllm/common/gradcam.py function getAttMap (line 7) | def getAttMap(img, attMap, blur=True, overlap=True): FILE: stllm/common/logger.py class SmoothedValue (line 19) | class SmoothedValue(object): method __init__ (line 24) | def __init__(self, window_size=20, fmt=None): method update (line 32) | def update(self, value, n=1): method synchronize_between_processes (line 37) | def synchronize_between_processes(self): method median (line 51) | def median(self): method avg (line 56) | def avg(self): method global_avg (line 61) | def global_avg(self): method max (line 65) | def max(self): method value (line 69) | def value(self): method __str__ (line 72) | def __str__(self): class MetricLogger (line 82) | class MetricLogger(object): method __init__ (line 83) | def __init__(self, delimiter="\t"): method update (line 87) | def update(self, **kwargs): method __getattr__ (line 94) | def __getattr__(self, attr): method __str__ (line 103) | def __str__(self): method global_avg (line 109) | def global_avg(self): method synchronize_between_processes (line 115) | def synchronize_between_processes(self): method add_meter (line 119) | def add_meter(self, name, meter): method log_every (line 122) | def log_every(self, iterable, print_freq, header=None): class AttrDict (line 184) | class AttrDict(dict): method __init__ (line 185) | def __init__(self, *args, **kwargs): function setup_logger (line 190) | def setup_logger(): FILE: stllm/common/optims.py class LinearWarmupStepLRScheduler (line 14) | class LinearWarmupStepLRScheduler: method __init__ (line 15) | def __init__( method step (line 37) | def step(self, cur_epoch, cur_step): class LinearWarmupCosineLRScheduler (line 56) | class LinearWarmupCosineLRScheduler: method __init__ (line 57) | def __init__( method step (line 78) | def step(self, cur_epoch, cur_step): function cosine_lr_schedule (line 97) | def cosine_lr_schedule(optimizer, epoch, max_epoch, init_lr, min_lr): function warmup_lr_schedule (line 105) | def warmup_lr_schedule(optimizer, step, max_step, init_lr, max_lr): function step_lr_schedule (line 111) | def step_lr_schedule(optimizer, epoch, init_lr, min_lr, decay_rate): FILE: stllm/common/registry.py class Registry (line 9) | class Registry: method register_builder (line 22) | def register_builder(cls, name): method register_task (line 54) | def register_task(cls, name): method register_model (line 83) | def register_model(cls, name): method register_processor (line 112) | def register_processor(cls, name): method register_lr_scheduler (line 141) | def register_lr_scheduler(cls, name): method register_runner (line 165) | def register_runner(cls, name): method register_path (line 189) | def register_path(cls, name, path): method register (line 205) | def register(cls, name, obj): method get_builder_class (line 232) | def get_builder_class(cls, name): method get_model_class (line 236) | def get_model_class(cls, name): method get_task_class (line 240) | def get_task_class(cls, name): method get_processor_class (line 244) | def get_processor_class(cls, name): method get_lr_scheduler_class (line 248) | def get_lr_scheduler_class(cls, name): method get_runner_class (line 252) | def get_runner_class(cls, name): method list_runners (line 256) | def list_runners(cls): method list_models (line 260) | def list_models(cls): method list_tasks (line 264) | def list_tasks(cls): method list_processors (line 268) | def list_processors(cls): method list_lr_schedulers (line 272) | def list_lr_schedulers(cls): method list_datasets (line 276) | def list_datasets(cls): method get_path (line 280) | def get_path(cls, name): method get (line 284) | def get(cls, name, default=None, no_warning=False): method unregister (line 315) | def unregister(cls, name): FILE: stllm/common/utils.py function now (line 35) | def now(): function is_url (line 41) | def is_url(url_or_filename): function get_cache_path (line 46) | def get_cache_path(rel_path): function get_abs_path (line 50) | def get_abs_path(rel_path): function load_json (line 54) | def load_json(filename): function makedir (line 64) | def makedir(dir_path): function get_redirected_url (line 78) | def get_redirected_url(url: str): function to_google_drive_download_url (line 93) | def to_google_drive_download_url(view_url: str) -> str: function download_google_drive_url (line 108) | def download_google_drive_url(url: str, output_path: str, output_file_na... function _get_google_drive_file_id (line 141) | def _get_google_drive_file_id(url: str) -> Optional[str]: function _urlretrieve (line 154) | def _urlretrieve(url: str, filename: str, chunk_size: int = 1024) -> None: function download_url (line 167) | def download_url( function download_and_extract_archive (line 221) | def download_and_extract_archive( function cache_url (line 242) | def cache_url(url: str, cache_dir: str) -> str: function create_file_symlink (line 261) | def create_file_symlink(file1, file2): function save_file (line 275) | def save_file(data, filename, append_to_json=True, verbose=True): function load_file (line 313) | def load_file(filename, mmap_mode=None, verbose=True, allow_pickle=False): function abspath (line 374) | def abspath(resource_path: str): function makedir (line 386) | def makedir(dir_path): function is_url (line 400) | def is_url(input_url): function cleanup_dir (line 408) | def cleanup_dir(dir): function get_file_size (line 419) | def get_file_size(filename): FILE: stllm/conversation/conversation.py class SeparatorStyle (line 24) | class SeparatorStyle(Enum): class Conversation (line 31) | class Conversation: method get_prompt (line 46) | def get_prompt(self): method append_message (line 67) | def append_message(self, role, message): method to_gradio_chatbot (line 70) | def to_gradio_chatbot(self): method copy (line 79) | def copy(self): method dict (line 92) | def dict(self): class StoppingCriteriaSub (line 105) | class StoppingCriteriaSub(StoppingCriteria): method __init__ (line 107) | def __init__(self, stops=[], encounters=1): method __call__ (line 111) | def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTen... function get_residual_index (line 118) | def get_residual_index(sample_segments, total_segments, devices): class Chat (line 181) | class Chat: method __init__ (line 182) | def __init__(self, model, device='cuda:0'): method ask (line 205) | def ask(self, text, conv): method answer (line 213) | def answer(self, conv, img_list, max_new_tokens=300, num_beams=1, min_... method upload_img (line 255) | def upload_img(self, image, conv, img_list): method upload_video (line 274) | def upload_video(self, video, conv, img_list, num_frame=64, text=None): method get_context_emb (line 301) | def get_context_emb(self, conv, img_list): method get_context_emb_sim (line 322) | def get_context_emb_sim(self, conv, img_list, system=True): FILE: stllm/conversation/mvbench_conversation.py function get_prompt (line 5) | def get_prompt(conv): function get_prompt2 (line 14) | def get_prompt2(conv): function get_context_emb (line 28) | def get_context_emb(conv, model, img_list, answer_prompt=None): function get_context_emb_sim (line 62) | def get_context_emb_sim(conv, model, img_list, answer_prompt=None): function ask (line 87) | def ask(text, conv): class StoppingCriteriaSub (line 90) | class StoppingCriteriaSub(StoppingCriteria): method __init__ (line 91) | def __init__(self, stops=[], encounters=1): method __call__ (line 94) | def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTen... function answer (line 100) | def answer(conv, model, img_list, ask_simple=False, do_sample=True, max_... class EasyDict (line 144) | class EasyDict(dict): method __init__ (line 256) | def __init__(self, d=None, **kwargs): method __setattr__ (line 268) | def __setattr__(self, name, value): method update (line 278) | def update(self, e=None, **f): method pop (line 284) | def pop(self, k, d=None): FILE: stllm/datasets/builders/__init__.py function load_dataset (line 23) | def load_dataset(name, cfg_path=None, vis_path=None, data_type=None): class DatasetZoo (line 61) | class DatasetZoo: method __init__ (line 62) | def __init__(self) -> None: method get_names (line 68) | def get_names(self): FILE: stllm/datasets/builders/base_dataset_builder.py class BaseDatasetBuilder (line 25) | class BaseDatasetBuilder: method __init__ (line 28) | def __init__(self, cfg=None): method build_datasets (line 45) | def build_datasets(self): method build_processors (line 61) | def build_processors(self): method _build_proc_from_cfg (line 80) | def _build_proc_from_cfg(cfg): method default_config_path (line 88) | def default_config_path(cls, type="default"): method _download_data (line 91) | def _download_data(self): method _download_ann (line 95) | def _download_ann(self): method _download_vis (line 152) | def _download_vis(self): method build (line 166) | def build(self): function load_dataset_config (line 232) | def load_dataset_config(cfg_path): FILE: stllm/datasets/builders/image_text_pair_builder.py class CCSBUBuilder (line 12) | class CCSBUBuilder(BaseDatasetBuilder): method _download_ann (line 17) | def _download_ann(self): method _download_vis (line 20) | def _download_vis(self): method build (line 23) | def build(self): class LaionBuilder (line 44) | class LaionBuilder(BaseDatasetBuilder): method _download_ann (line 49) | def _download_ann(self): method _download_vis (line 52) | def _download_vis(self): method build (line 55) | def build(self): class CCSBUAlignBuilder (line 76) | class CCSBUAlignBuilder(BaseDatasetBuilder): method build_datasets (line 83) | def build_datasets(self): FILE: stllm/datasets/data_utils.py class ChainDataset (line 33) | class ChainDataset(wds.DataPipeline): method __init__ (line 43) | def __init__(self, datasets: List[wds.DataPipeline]) -> None: method __iter__ (line 59) | def __iter__(self): function apply_to_sample (line 66) | def apply_to_sample(f, sample): function move_to_cuda (line 83) | def move_to_cuda(sample): function prepare_sample (line 90) | def prepare_sample(samples, cuda_enabled=True): function reorg_datasets_by_split (line 99) | def reorg_datasets_by_split(datasets): function concat_datasets (line 125) | def concat_datasets(datasets): FILE: stllm/datasets/datasets/base_dataset.py class BaseDataset (line 15) | class BaseDataset(Dataset): method __init__ (line 16) | def __init__( method __len__ (line 38) | def __len__(self): method collater (line 41) | def collater(self, samples): method set_processors (line 44) | def set_processors(self, vis_processor, text_processor): method _add_instance_ids (line 48) | def _add_instance_ids(self, key="instance_id"): class ConcatDataset (line 53) | class ConcatDataset(ConcatDataset): method __init__ (line 54) | def __init__(self, datasets: Iterable[Dataset]) -> None: method collater (line 57) | def collater(self, samples): FILE: stllm/datasets/datasets/caption_datasets.py class __DisplMixin (line 15) | class __DisplMixin: method displ_item (line 16) | def displ_item(self, index): class CaptionDataset (line 28) | class CaptionDataset(BaseDataset, __DisplMixin): method __init__ (line 29) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 44) | def __getitem__(self, index): class CaptionEvalDataset (line 63) | class CaptionEvalDataset(BaseDataset, __DisplMixin): method __init__ (line 64) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 72) | def __getitem__(self, index): FILE: stllm/datasets/datasets/cc_sbu_dataset.py class CCSBUDataset (line 9) | class CCSBUDataset(BaseDataset): method __init__ (line 10) | def __init__(self, vis_processor, text_processor, location): method to_dict (line 23) | def to_dict(self, sample): class CCSBUAlignDataset (line 30) | class CCSBUAlignDataset(CaptionDataset): method __getitem__ (line 32) | def __getitem__(self, index): FILE: stllm/datasets/datasets/dataloader_utils.py class MultiIterLoader (line 15) | class MultiIterLoader: method __init__ (line 24) | def __init__(self, loaders, ratios=None): method __next__ (line 40) | def __next__(self): class MetaLoader (line 45) | class MetaLoader(object): method __init__ (line 47) | def __init__(self, loaders, ratios=None): method build_iter (line 57) | def build_iter(self): method __len__ (line 73) | def __len__(self): method __iter__ (line 76) | def __iter__(self): class PrefetchLoader (line 84) | class PrefetchLoader(object): method __init__ (line 92) | def __init__(self, loader): method __iter__ (line 96) | def __iter__(self): method __len__ (line 111) | def __len__(self): method preload (line 114) | def preload(self, it): method next (line 139) | def next(self, it): method __getattr__ (line 147) | def __getattr__(self, name): function record_cuda_stream (line 152) | def record_cuda_stream(batch): class IterLoader (line 165) | class IterLoader: method __init__ (line 173) | def __init__(self, dataloader: DataLoader, use_distributed: bool = Fal... method epoch (line 180) | def epoch(self) -> int: method __next__ (line 183) | def __next__(self): method __iter__ (line 196) | def __iter__(self): method __len__ (line 199) | def __len__(self): FILE: stllm/datasets/datasets/image_video_itdatasets.py class ImageVideoBaseDataset (line 25) | class ImageVideoBaseDataset(Dataset): method __init__ (line 30) | def __init__(self): method __getitem__ (line 44) | def __getitem__(self, index): method __len__ (line 47) | def __len__(self): method get_anno (line 50) | def get_anno(self, index): method load_and_transform_media_data (line 66) | def load_and_transform_media_data(self, index, data_path): method load_and_transform_media_data_image (line 72) | def load_and_transform_media_data_image(self, index, data_path): method load_and_transform_media_data_video (line 77) | def load_and_transform_media_data_video(self, index, data_path, return... class PTImgTrainDataset (line 107) | class PTImgTrainDataset(ImageVideoBaseDataset): method __init__ (line 110) | def __init__(self, ann_file, transform, pre_text=True): method get_anno (line 128) | def get_anno(self, index): method __len__ (line 134) | def __len__(self): method __getitem__ (line 137) | def __getitem__(self, index): class PTVidTrainDataset (line 148) | class PTVidTrainDataset(PTImgTrainDataset): method __init__ (line 151) | def __init__( class ITImgTrainDataset (line 168) | class ITImgTrainDataset(ImageVideoBaseDataset): method __init__ (line 171) | def __init__( method get_anno (line 206) | def get_anno(self, index): method __len__ (line 220) | def __len__(self): method process_qa (line 223) | def process_qa(self, qa, msg=""): method __getitem__ (line 252) | def __getitem__(self, index): class ITVidTrainDataset (line 268) | class ITVidTrainDataset(ITImgTrainDataset): method __init__ (line 271) | def __init__( method __getitem__ (line 297) | def __getitem__(self, index): FILE: stllm/datasets/datasets/laion_dataset.py class LaionDataset (line 12) | class LaionDataset(BaseDataset): method __init__ (line 13) | def __init__(self, vis_processor, text_processor, location): method to_dict (line 26) | def to_dict(self, sample): FILE: stllm/datasets/datasets/utils.py function load_image_from_path (line 32) | def load_image_from_path(image_path, client): function load_anno (line 43) | def load_anno(ann_file_list): function pre_text (line 80) | def pre_text(text, max_l=None, pre_text=True): function collect_result (line 100) | def collect_result(result, result_dir, filename, is_json=True, is_list=T... function sync_save_result (line 138) | def sync_save_result(result, result_dir, filename, is_json=True, is_list... function pad_sequences_1d (line 184) | def pad_sequences_1d(sequences, dtype=torch.long, device=torch.device("c... function pts_to_secs (line 234) | def pts_to_secs(pts: int, time_base: float, start_pts: int) -> float: function get_pyav_video_duration (line 249) | def get_pyav_video_duration(video_reader): function get_frame_indices_by_fps (line 259) | def get_frame_indices_by_fps(): function get_frame_indices (line 262) | def get_frame_indices(num_frames, vlen, sample='rand', fix_start=None, i... function read_frames_av (line 302) | def read_frames_av( function read_frames_gif (line 319) | def read_frames_gif( function read_frames_decord (line 345) | def read_frames_decord( function read_frames_rawframes (line 375) | def read_frames_rawframes( FILE: stllm/models/Qformer.py class BertEmbeddings (line 51) | class BertEmbeddings(nn.Module): method __init__ (line 54) | def __init__(self, config): method forward (line 78) | def forward( class BertSelfAttention (line 111) | class BertSelfAttention(nn.Module): method __init__ (line 112) | def __init__(self, config, is_cross_attention): method save_attn_gradients (line 149) | def save_attn_gradients(self, attn_gradients): method get_attn_gradients (line 152) | def get_attn_gradients(self): method save_attention_map (line 155) | def save_attention_map(self, attention_map): method get_attention_map (line 158) | def get_attention_map(self): method transpose_for_scores (line 161) | def transpose_for_scores(self, x): method forward (line 169) | def forward( class BertSelfOutput (line 278) | class BertSelfOutput(nn.Module): method __init__ (line 279) | def __init__(self, config): method forward (line 285) | def forward(self, hidden_states, input_tensor): class BertAttention (line 292) | class BertAttention(nn.Module): method __init__ (line 293) | def __init__(self, config, is_cross_attention=False): method prune_heads (line 299) | def prune_heads(self, heads): method forward (line 322) | def forward( class BertIntermediate (line 349) | class BertIntermediate(nn.Module): method __init__ (line 350) | def __init__(self, config): method forward (line 358) | def forward(self, hidden_states): class BertOutput (line 364) | class BertOutput(nn.Module): method __init__ (line 365) | def __init__(self, config): method forward (line 371) | def forward(self, hidden_states, input_tensor): class BertLayer (line 378) | class BertLayer(nn.Module): method __init__ (line 379) | def __init__(self, config, layer_num): method forward (line 402) | def forward( method feed_forward_chunk (line 476) | def feed_forward_chunk(self, attention_output): method feed_forward_chunk_query (line 481) | def feed_forward_chunk_query(self, attention_output): class BertEncoder (line 487) | class BertEncoder(nn.Module): method __init__ (line 488) | def __init__(self, config): method forward (line 495) | def forward( class BertPooler (line 592) | class BertPooler(nn.Module): method __init__ (line 593) | def __init__(self, config): method forward (line 598) | def forward(self, hidden_states): class BertPredictionHeadTransform (line 607) | class BertPredictionHeadTransform(nn.Module): method __init__ (line 608) | def __init__(self, config): method forward (line 617) | def forward(self, hidden_states): class BertLMPredictionHead (line 624) | class BertLMPredictionHead(nn.Module): method __init__ (line 625) | def __init__(self, config): method forward (line 638) | def forward(self, hidden_states): class BertOnlyMLMHead (line 644) | class BertOnlyMLMHead(nn.Module): method __init__ (line 645) | def __init__(self, config): method forward (line 649) | def forward(self, sequence_output): class BertPreTrainedModel (line 654) | class BertPreTrainedModel(PreTrainedModel): method _init_weights (line 664) | def _init_weights(self, module): class BertModel (line 677) | class BertModel(BertPreTrainedModel): method __init__ (line 687) | def __init__(self, config, add_pooling_layer=False): method get_input_embeddings (line 699) | def get_input_embeddings(self): method set_input_embeddings (line 702) | def set_input_embeddings(self, value): method _prune_heads (line 705) | def _prune_heads(self, heads_to_prune): method get_extended_attention_mask (line 713) | def get_extended_attention_mask( method forward (line 804) | def forward( class BertLMHeadModel (line 968) | class BertLMHeadModel(BertPreTrainedModel): method __init__ (line 973) | def __init__(self, config): method get_output_embeddings (line 981) | def get_output_embeddings(self): method set_output_embeddings (line 984) | def set_output_embeddings(self, new_embeddings): method forward (line 987) | def forward( method prepare_inputs_for_generation (line 1097) | def prepare_inputs_for_generation( method _reorder_cache (line 1120) | def _reorder_cache(self, past, beam_idx): class BertForMaskedLM (line 1131) | class BertForMaskedLM(BertPreTrainedModel): method __init__ (line 1136) | def __init__(self, config): method get_output_embeddings (line 1144) | def get_output_embeddings(self): method set_output_embeddings (line 1147) | def set_output_embeddings(self, new_embeddings): method forward (line 1150) | def forward( FILE: stllm/models/__init__.py function load_model (line 27) | def load_model(name, model_type, is_eval=False, device="cpu", checkpoint... function load_preprocess (line 61) | def load_preprocess(config): function load_model_and_preprocess (line 113) | def load_model_and_preprocess(name, model_type, is_eval=False, device="c... class ModelZoo (line 161) | class ModelZoo: method __init__ (line 172) | def __init__(self) -> None: method __str__ (line 178) | def __str__(self) -> str: method __iter__ (line 193) | def __iter__(self): method __len__ (line 196) | def __len__(self): FILE: stllm/models/base_decoder.py class DropPath (line 10) | class DropPath(nn.Module): method __init__ (line 13) | def __init__(self, drop_prob=None): method forward (line 17) | def forward(self, x): method extra_repr (line 20) | def extra_repr(self) -> str: class Mlp (line 24) | class Mlp(nn.Module): method __init__ (line 25) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 34) | def forward(self, x): class Attention (line 44) | class Attention(nn.Module): method __init__ (line 45) | def __init__( method forward (line 68) | def forward(self, x): class Block (line 91) | class Block(nn.Module): method __init__ (line 93) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, qk_sc... method forward (line 113) | def forward(self, x): class PretrainVisionTransformerDecoder (line 123) | class PretrainVisionTransformerDecoder(nn.Module): method __init__ (line 126) | def __init__(self, embed_dim=4096, depth=2, num_heads=32, mlp_ratio=2.... method _init_weights (line 147) | def _init_weights(self, m): method get_num_layers (line 156) | def get_num_layers(self): method no_weight_decay (line 160) | def no_weight_decay(self): method get_classifier (line 163) | def get_classifier(self): method reset_classifier (line 166) | def reset_classifier(self, num_classes, global_pool=''): method forward (line 170) | def forward(self, x, return_token_num = 0): FILE: stllm/models/base_model.py class BaseModel (line 19) | class BaseModel(nn.Module): method __init__ (line 22) | def __init__(self): method device (line 26) | def device(self): method load_checkpoint (line 29) | def load_checkpoint(self, url_or_filename): method from_pretrained (line 59) | def from_pretrained(cls, model_type): method default_config_path (line 75) | def default_config_path(cls, model_type): method load_checkpoint_from_config (line 81) | def load_checkpoint_from_config(self, cfg, **kwargs): method before_evaluation (line 102) | def before_evaluation(self, **kwargs): method show_n_params (line 105) | def show_n_params(self, return_str=True): class BaseEncoder (line 121) | class BaseEncoder(nn.Module): method __init__ (line 126) | def __init__(self): method forward_features (line 129) | def forward_features(self, samples, **kwargs): method device (line 133) | def device(self): class SharedQueueMixin (line 137) | class SharedQueueMixin: method _dequeue_and_enqueue (line 139) | def _dequeue_and_enqueue(self, image_feat, text_feat, idxs=None): class MomentumDistilationMixin (line 161) | class MomentumDistilationMixin: method copy_params (line 163) | def copy_params(self): method _momentum_update (line 172) | def _momentum_update(self): class GatherLayer (line 182) | class GatherLayer(torch.autograd.Function): method forward (line 189) | def forward(ctx, x): method backward (line 197) | def backward(ctx, *grads): function all_gather_with_grad (line 203) | def all_gather_with_grad(tensors): function concat_all_gather (line 221) | def concat_all_gather(tensor): function tile (line 239) | def tile(x, dim, n_tile): FILE: stllm/models/blip2.py class Blip2Base (line 29) | class Blip2Base(BaseModel): method init_tokenizer (line 31) | def init_tokenizer(cls, truncation_side="right"): method maybe_autocast (line 36) | def maybe_autocast(self, dtype=torch.float16): method init_Qformer (line 47) | def init_Qformer(cls, num_query_token, vision_width, cross_attention_f... method init_vision_encoder (line 62) | def init_vision_encoder( method load_from_pretrained (line 76) | def load_from_pretrained(self, url_or_filename): function disabled_train (line 97) | def disabled_train(self, mode=True): class LayerNorm (line 103) | class LayerNorm(nn.LayerNorm): method forward (line 106) | def forward(self, x: torch.Tensor): function compute_sim_matrix (line 112) | def compute_sim_matrix(model, data_loader, **kwargs): FILE: stllm/models/blip2_outputs.py class BlipSimilarity (line 20) | class BlipSimilarity(ModelOutput): class BlipIntermediateOutput (line 32) | class BlipIntermediateOutput(ModelOutput): class BlipOutput (line 73) | class BlipOutput(ModelOutput): class BlipOutputFeatures (line 89) | class BlipOutputFeatures(ModelOutput): FILE: stllm/models/eva_btadapter.py function constant_init (line 40) | def constant_init(module, val, bias=0): class EVAVisionTransformer_BTAdapter (line 46) | class EVAVisionTransformer_BTAdapter(nn.Module): method __init__ (line 49) | def __init__(self, depth=4, mask_rate=0): method init_weights (line 89) | def init_weights(self): method fix_init_weight (line 101) | def fix_init_weight(self): method get_cast_dtype (line 112) | def get_cast_dtype(self) -> torch.dtype: method _init_weights (line 115) | def _init_weights(self, m): method get_num_layers (line 124) | def get_num_layers(self): method lock (line 127) | def lock(self, unlocked_groups=0, freeze_bn_stats=False): method set_grad_checkpointing (line 133) | def set_grad_checkpointing(self, enable=True): method no_weight_decay (line 137) | def no_weight_decay(self): method get_classifier (line 140) | def get_classifier(self): method reset_classifier (line 143) | def reset_classifier(self, num_classes, global_pool=''): method forward_features (line 147) | def forward_features(self, x, mask=None): method forward_branch (line 186) | def forward_branch(self, x, branch_x, num_layer, mask=None): method init_input (line 209) | def init_input(self, x, mask=None): method forward (line 233) | def forward(self, x, return_all_features=False): class BTAdapter_Spatial (line 257) | class BTAdapter_Spatial(Block): method __init__ (line 258) | def __init__(self, d_model, n_head, drop_num=0.1): method forward (line 261) | def forward(self, x, T): class BTAdapter_Temp (line 283) | class BTAdapter_Temp(nn.Module): method __init__ (line 284) | def __init__(self, d_model, n_head, drop_num=0.1, norm_layer=partial(n... method forward (line 295) | def forward(self, x, T): function create_eva_btadapter (line 312) | def create_eva_btadapter(precision="fp16"): FILE: stllm/models/eva_vit.py function _cfg (line 20) | def _cfg(url='', **kwargs): class DropPath (line 30) | class DropPath(nn.Module): method __init__ (line 33) | def __init__(self, drop_prob=None): method forward (line 37) | def forward(self, x): method extra_repr (line 40) | def extra_repr(self) -> str: class Mlp (line 44) | class Mlp(nn.Module): method __init__ (line 45) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 54) | def forward(self, x): class Attention (line 64) | class Attention(nn.Module): method __init__ (line 65) | def __init__( method forward (line 118) | def forward(self, x, rel_pos_bias=None): class Block (line 151) | class Block(nn.Module): method __init__ (line 153) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, qk_sc... method forward (line 173) | def forward(self, x, rel_pos_bias=None): class PatchEmbed (line 183) | class PatchEmbed(nn.Module): method __init__ (line 186) | def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=... method forward (line 198) | def forward(self, x, **kwargs): class RelativePositionBias (line 207) | class RelativePositionBias(nn.Module): method __init__ (line 209) | def __init__(self, window_size, num_heads): method forward (line 238) | def forward(self): class VisionTransformer (line 246) | class VisionTransformer(nn.Module): method __init__ (line 249) | def __init__(self, img_size=224, patch_size=16, in_chans=3, num_classe... method fix_init_weight (line 300) | def fix_init_weight(self): method _init_weights (line 308) | def _init_weights(self, m): method get_classifier (line 317) | def get_classifier(self): method reset_classifier (line 320) | def reset_classifier(self, num_classes, global_pool=''): method forward_features (line 324) | def forward_features(self, x): method forward (line 349) | def forward(self, x): method get_intermediate_layers (line 354) | def get_intermediate_layers(self, x): function interpolate_pos_embed (line 373) | def interpolate_pos_embed(model, checkpoint_model): function convert_weights_to_fp16 (line 397) | def convert_weights_to_fp16(model: nn.Module): function create_eva_vit_g (line 415) | def create_eva_vit_g(img_size=224,drop_path_rate=0.4,use_checkpoint=Fals... FILE: stllm/models/modeling_llama_mem.py function _make_causal_mask (line 29) | def _make_causal_mask( function _expand_mask (line 47) | def _expand_mask(mask: torch.Tensor, dtype: torch.dtype, tgt_len: Option... class LlamaRMSNorm (line 61) | class LlamaRMSNorm(nn.Module): method __init__ (line 62) | def __init__(self, hidden_size, eps=1e-6): method forward (line 70) | def forward(self, hidden_states): class LlamaRotaryEmbedding (line 81) | class LlamaRotaryEmbedding(torch.nn.Module): method __init__ (line 82) | def __init__(self, dim, max_position_embeddings=2048, base=10000, devi... method forward (line 96) | def forward(self, x, seq_len=None): function rotate_half (line 113) | def rotate_half(x): function apply_rotary_pos_emb (line 120) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids): class LlamaMLP (line 130) | class LlamaMLP(nn.Module): method __init__ (line 131) | def __init__( method forward (line 143) | def forward(self, x): class LlamaAttention (line 147) | class LlamaAttention(nn.Module): method __init__ (line 150) | def __init__(self, config: LlamaConfig): method _shape (line 169) | def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int): method forward (line 172) | def forward( class LlamaDecoderLayer (line 251) | class LlamaDecoderLayer(nn.Module): method __init__ (line 252) | def __init__(self, config: LlamaConfig): method forward (line 264) | def forward( class LlamaPreTrainedModel (line 340) | class LlamaPreTrainedModel(PreTrainedModel): method _init_weights (line 347) | def _init_weights(self, module): method _set_gradient_checkpointing (line 358) | def _set_gradient_checkpointing(self, module, value=False): class LlamaModel (line 431) | class LlamaModel(LlamaPreTrainedModel): method __init__ (line 439) | def __init__(self, config: LlamaConfig): method get_input_embeddings (line 452) | def get_input_embeddings(self): method set_input_embeddings (line 455) | def set_input_embeddings(self, value): method _prepare_decoder_attention_mask (line 458) | def _prepare_decoder_attention_mask(self, attention_mask, input_shape, method forward (line 464) | def forward( class LlamaForCausalLM (line 597) | class LlamaForCausalLM(LlamaPreTrainedModel): method __init__ (line 598) | def __init__(self, config): method get_input_embeddings (line 607) | def get_input_embeddings(self): method set_input_embeddings (line 610) | def set_input_embeddings(self, value): method get_output_embeddings (line 613) | def get_output_embeddings(self): method set_output_embeddings (line 616) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 619) | def set_decoder(self, decoder): method get_decoder (line 622) | def get_decoder(self): method forward (line 627) | def forward( method prepare_inputs_for_generation (line 715) | def prepare_inputs_for_generation( method _reorder_cache (line 748) | def _reorder_cache(past_key_values, beam_idx): FILE: stllm/models/peft_model.py function forward (line 26) | def forward( function replace_peftmodel_with_sample_input (line 101) | def replace_peftmodel_with_sample_input(): FILE: stllm/models/st_llm.py class StllmConfig (line 31) | class StllmConfig(LlamaConfig): class Linear_Decoder (line 35) | class Linear_Decoder(nn.Module): method __init__ (line 36) | def __init__(self, output_dim=4096, embed_dim=4096): method forward (line 41) | def forward(self, x): class STLLMLlamaModel (line 45) | class STLLMLlamaModel(LlamaModel): method __init__ (line 47) | def __init__(self, config: LlamaConfig): # TODO: Remove unused params method initialize_vision_modules (line 50) | def initialize_vision_modules(self, cfg): method forward (line 56) | def forward(self, samples=None, inputs_embeds=None, **kwargs): class STLLMForCausalLM (line 95) | class STLLMForCausalLM(LlamaForCausalLM, BaseModel): method __init__ (line 104) | def __init__(self, config): method get_model (line 113) | def get_model(self): method forward (line 116) | def forward(self, samples=None, inputs_embeds=None, **kwargs): method get_state_dict (line 150) | def get_state_dict(self, path, prefix='pytorch_model'): method from_config (line 161) | def from_config(cls, cfg): class STLLMModel (line 205) | class STLLMModel(Blip2Base): method __init__ (line 209) | def __init__( method encode_img (line 321) | def encode_img(self, image, text=None): method prompt_wrap (line 379) | def prompt_wrap(self, img_embeds, atts_img, prompts): method concat_emb_input_output (line 409) | def concat_emb_input_output(self, input_embs, input_atts, output_embs,... method get_residual_index (line 434) | def get_residual_index(self, sample_segments, total_segments, devices): method forward (line 447) | def forward(self, samples): method from_config (line 549) | def from_config(cls, cfg): FILE: stllm/models/utils.py function RandomMaskingGenerator (line 4) | def RandomMaskingGenerator(num_patches, mask_ratio, batch, device='cuda'): function get_sinusoid_encoding_table (line 18) | def get_sinusoid_encoding_table(n_position, d_hid): FILE: stllm/processors/__init__.py function load_processor (line 25) | def load_processor(name, cfg=None): FILE: stllm/processors/base_processor.py class BaseProcessor (line 11) | class BaseProcessor: method __init__ (line 12) | def __init__(self): method __call__ (line 16) | def __call__(self, item): method from_config (line 20) | def from_config(cls, cfg=None): method build (line 23) | def build(self, **kwargs): FILE: stllm/processors/blip_processors.py class BlipImageBaseProcessor (line 19) | class BlipImageBaseProcessor(BaseProcessor): method __init__ (line 20) | def __init__(self, mean=None, std=None): class BlipCaptionProcessor (line 30) | class BlipCaptionProcessor(BaseProcessor): method __init__ (line 31) | def __init__(self, prompt="", max_words=50): method __call__ (line 35) | def __call__(self, caption): method from_config (line 41) | def from_config(cls, cfg=None): method pre_caption (line 50) | def pre_caption(self, caption): class Blip2ImageTrainProcessor (line 73) | class Blip2ImageTrainProcessor(BlipImageBaseProcessor): method __init__ (line 74) | def __init__(self, image_size=224, mean=None, std=None, min_scale=0.5,... method __call__ (line 89) | def __call__(self, item): method from_config (line 93) | def from_config(cls, cfg=None): class Blip2VideoTrainProcessor (line 114) | class Blip2VideoTrainProcessor(BaseProcessor): method __init__ (line 115) | def __init__(self, num_frames=16, test_mode=True): method __call__ (line 125) | def __call__(self, item): method from_config (line 129) | def from_config(cls, cfg=None): class Blip2ImageEvalProcessor (line 139) | class Blip2ImageEvalProcessor(BlipImageBaseProcessor): method __init__ (line 140) | def __init__(self, image_size=224, mean=None, std=None): method __call__ (line 153) | def __call__(self, item): method from_config (line 157) | def from_config(cls, cfg=None): FILE: stllm/processors/randaugment.py function identity_func (line 15) | def identity_func(img): function autocontrast_func (line 19) | def autocontrast_func(img, cutoff=0): function equalize_func (line 52) | def equalize_func(img): function rotate_func (line 76) | def rotate_func(img, degree, fill=(0, 0, 0)): function solarize_func (line 87) | def solarize_func(img, thresh=128): function color_func (line 97) | def color_func(img, factor): function contrast_func (line 115) | def contrast_func(img, factor): function brightness_func (line 129) | def brightness_func(img, factor): function sharpness_func (line 138) | def sharpness_func(img, factor): function shear_x_func (line 159) | def shear_x_func(img, factor, fill=(0, 0, 0)): function translate_x_func (line 168) | def translate_x_func(img, offset, fill=(0, 0, 0)): function translate_y_func (line 180) | def translate_y_func(img, offset, fill=(0, 0, 0)): function posterize_func (line 192) | def posterize_func(img, bits): function shear_y_func (line 200) | def shear_y_func(img, factor, fill=(0, 0, 0)): function cutout_func (line 209) | def cutout_func(img, pad_size, replace=(0, 0, 0)): function enhance_level_to_args (line 223) | def enhance_level_to_args(MAX_LEVEL): function shear_level_to_args (line 230) | def shear_level_to_args(MAX_LEVEL, replace_value): function translate_level_to_args (line 240) | def translate_level_to_args(translate_const, MAX_LEVEL, replace_value): function cutout_level_to_args (line 250) | def cutout_level_to_args(cutout_const, MAX_LEVEL, replace_value): function solarize_level_to_args (line 258) | def solarize_level_to_args(MAX_LEVEL): function none_level_to_args (line 266) | def none_level_to_args(level): function posterize_level_to_args (line 270) | def posterize_level_to_args(MAX_LEVEL): function rotate_level_to_args (line 278) | def rotate_level_to_args(MAX_LEVEL, replace_value): class RandomAugment (line 326) | class RandomAugment(object): method __init__ (line 327) | def __init__(self, N=2, M=10, isPIL=False, augs=[]): method get_random_ops (line 336) | def get_random_ops(self): method __call__ (line 340) | def __call__(self, img): class VideoRandomAugment (line 352) | class VideoRandomAugment(object): method __init__ (line 353) | def __init__(self, N=2, M=10, p=0.0, tensor_in_tensor_out=True, augs=[]): method get_random_ops (line 363) | def get_random_ops(self): method __call__ (line 367) | def __call__(self, frames): method _aug (line 386) | def _aug(self, img, ops, apply_or_not): FILE: stllm/processors/video_transform.py class SampleFrames (line 3) | class SampleFrames: method __init__ (line 40) | def __init__(self, method _get_train_clips (line 61) | def _get_train_clips(self, num_frames: int, method _get_test_clips (line 106) | def _get_test_clips(self, num_frames: int, method _sample_clips (line 147) | def _sample_clips(self, num_frames: int, ori_clip_len: float) -> np.ar... method _get_ori_clip_len (line 163) | def _get_ori_clip_len(self, fps_scale_ratio: float) -> float: method __call__ (line 180) | def __call__(self, x): FILE: stllm/runners/runner_base.py class RunnerBase (line 39) | class RunnerBase: method __init__ (line 47) | def __init__(self, cfg, task, model, datasets, job_id): method device (line 69) | def device(self): method use_distributed (line 76) | def use_distributed(self): method model (line 80) | def model(self): method optimizer (line 100) | def optimizer(self): method scaler (line 133) | def scaler(self): method lr_scheduler (line 143) | def lr_scheduler(self): method dataloaders (line 185) | def dataloaders(self) -> dict: method cuda_enabled (line 282) | def cuda_enabled(self): method max_epoch (line 286) | def max_epoch(self): method log_freq (line 290) | def log_freq(self): method init_lr (line 295) | def init_lr(self): method min_lr (line 299) | def min_lr(self): method accum_grad_iters (line 303) | def accum_grad_iters(self): method valid_splits (line 307) | def valid_splits(self): method test_splits (line 316) | def test_splits(self): method train_splits (line 322) | def train_splits(self): method evaluate_only (line 331) | def evaluate_only(self): method use_dist_eval_sampler (line 338) | def use_dist_eval_sampler(self): method resume_ckpt_path (line 342) | def resume_ckpt_path(self): method train_loader (line 346) | def train_loader(self): method setup_output_dir (line 351) | def setup_output_dir(self): method train (line 366) | def train(self): method evaluate (line 426) | def evaluate(self, cur_epoch="best", skip_reload=False): method train_epoch (line 437) | def train_epoch(self, epoch): method eval_epoch (line 454) | def eval_epoch(self, split_name, cur_epoch, skip_reload=False): method unwrap_dist_model (line 488) | def unwrap_dist_model(self, model): method create_loaders (line 494) | def create_loaders( method _save_checkpoint (line 584) | def _save_checkpoint(self, cur_epoch, is_best=False): method _reload_best_model (line 611) | def _reload_best_model(self, model): method _load_checkpoint (line 631) | def _load_checkpoint(self, url_or_filename): method log_stats (line 656) | def log_stats(self, stats, split_name): method log_config (line 665) | def log_config(self): FILE: stllm/tasks/__init__.py function setup_task (line 13) | def setup_task(cfg): FILE: stllm/tasks/base_task.py class BaseTask (line 19) | class BaseTask: method __init__ (line 20) | def __init__(self, **kwargs): method setup_task (line 26) | def setup_task(cls, **kwargs): method build_model (line 29) | def build_model(self, cfg): method build_datasets (line 35) | def build_datasets(self, cfg): method train_step (line 67) | def train_step(self, model, samples): method valid_step (line 71) | def valid_step(self, model, samples): method before_evaluation (line 74) | def before_evaluation(self, model, dataset, **kwargs): method after_evaluation (line 77) | def after_evaluation(self, **kwargs): method inference_step (line 80) | def inference_step(self): method evaluation (line 83) | def evaluation(self, model, data_loader, cuda_enabled=True): method train_epoch (line 102) | def train_epoch( method train_iters (line 127) | def train_iters( method _train_inner_loop (line 155) | def _train_inner_loop( method save_result (line 249) | def save_result(result, result_dir, filename, remove_duplicate=""): FILE: stllm/tasks/image_text_pretrain.py class ImageTextPretrainTask (line 14) | class ImageTextPretrainTask(BaseTask): method __init__ (line 15) | def __init__(self): method evaluation (line 18) | def evaluation(self, model, data_loader, cuda_enabled=True): class VideoTextItTask (line 22) | class VideoTextItTask(ImageTextPretrainTask): method __init__ (line 23) | def __init__(self): method build_datasets (line 26) | def build_datasets(self, cfg): function get_media_type (line 51) | def get_media_type(dataset_info): FILE: stllm/test/gpt_evaluation/evaluate_activitynet_qa.py function parse_args (line 9) | def parse_args(): function annotate (line 20) | def annotate(prediction_set, caption_files, output_dir): function main (line 74) | def main(): FILE: stllm/test/gpt_evaluation/evaluate_benchmark_1_correctness.py function parse_args (line 9) | def parse_args(): function annotate (line 20) | def annotate(prediction_set, caption_files, output_dir): function main (line 76) | def main(): FILE: stllm/test/gpt_evaluation/evaluate_benchmark_2_detailed_orientation.py function parse_args (line 9) | def parse_args(): function annotate (line 20) | def annotate(prediction_set, caption_files, output_dir): function main (line 75) | def main(): FILE: stllm/test/gpt_evaluation/evaluate_benchmark_3_context.py function parse_args (line 9) | def parse_args(): function annotate (line 20) | def annotate(prediction_set, caption_files, output_dir): function main (line 75) | def main(): FILE: stllm/test/gpt_evaluation/evaluate_benchmark_4_temporal.py function parse_args (line 9) | def parse_args(): function annotate (line 20) | def annotate(prediction_set, caption_files, output_dir): function main (line 74) | def main(): FILE: stllm/test/gpt_evaluation/evaluate_benchmark_5_consistency.py function parse_args (line 9) | def parse_args(): function annotate (line 20) | def annotate(prediction_set, caption_files, output_dir): function main (line 80) | def main(): FILE: stllm/test/mvbench/mv_bench.py class MVBench_dataset (line 49) | class MVBench_dataset(Dataset): method __init__ (line 50) | def __init__(self, data_dir, data_list=data_list, num_segments=8, reso... method __str__ (line 87) | def __str__(self): method __len__ (line 109) | def __len__(self): method get_index (line 112) | def get_index(self, bound, fps, max_frame, first_idx=0): method read_video (line 141) | def read_video(self, video_path, bound=None): method read_gif (line 156) | def read_gif(self, video_path, bound=None, fps=25): method read_frame (line 171) | def read_frame(self, video_path, bound=None, fps=3): method qa_template (line 187) | def qa_template(self, data): method __getitem__ (line 200) | def __getitem__(self, idx): function get_residual_index (line 220) | def get_residual_index(sample_segments, total_segments, devices): function infer_mvbench (line 229) | def infer_mvbench( function check_ans (line 285) | def check_ans(pred, gt): FILE: stllm/test/mvbench/mv_bench_infer.py function parse_args (line 20) | def parse_args(): function run_inference (line 44) | def run_inference(args): FILE: stllm/test/qabench/activitynet_qa.py function parse_args (line 24) | def parse_args(): function run_inference (line 51) | def run_inference(args): FILE: stllm/test/qabench/msrvtt_qa.py function parse_args (line 23) | def parse_args(): function run_inference (line 48) | def run_inference(args): FILE: stllm/test/qabench/msvd_qa.py function parse_args (line 23) | def parse_args(): function run_inference (line 48) | def run_inference(args): FILE: stllm/test/vcgbench/videochatgpt_benchmark_consist.py function parse_args (line 23) | def parse_args(): function run_inference (line 48) | def run_inference(args): FILE: stllm/test/vcgbench/videochatgpt_benchmark_general.py function parse_args (line 23) | def parse_args(): function run_inference (line 48) | def run_inference(args): FILE: stllm/test/video_transforms.py class GroupRandomCrop (line 10) | class GroupRandomCrop(object): method __init__ (line 11) | def __init__(self, size): method __call__ (line 17) | def __call__(self, img_group): class MultiGroupRandomCrop (line 37) | class MultiGroupRandomCrop(object): method __init__ (line 38) | def __init__(self, size, groups=1): method __call__ (line 45) | def __call__(self, img_group): class GroupCenterCrop (line 66) | class GroupCenterCrop(object): method __init__ (line 67) | def __init__(self, size): method __call__ (line 70) | def __call__(self, img_group): class GroupRandomHorizontalFlip (line 74) | class GroupRandomHorizontalFlip(object): method __init__ (line 78) | def __init__(self, is_flow=False): method __call__ (line 81) | def __call__(self, img_group, is_flow=False): class GroupNormalize (line 94) | class GroupNormalize(object): method __init__ (line 95) | def __init__(self, mean, std): method __call__ (line 99) | def __call__(self, tensor): class GroupScale (line 110) | class GroupScale(object): method __init__ (line 119) | def __init__(self, size, interpolation=Image.BILINEAR): method __call__ (line 122) | def __call__(self, img_group): class GroupOverSample (line 126) | class GroupOverSample(object): method __init__ (line 127) | def __init__(self, crop_size, scale_size=None, flip=True): method __call__ (line 137) | def __call__(self, img_group): class GroupFullResSample (line 167) | class GroupFullResSample(object): method __init__ (line 168) | def __init__(self, crop_size, scale_size=None, flip=True): method __call__ (line 178) | def __call__(self, img_group): class GroupMultiScaleCrop (line 214) | class GroupMultiScaleCrop(object): method __init__ (line 216) | def __init__(self, input_size, scales=None, max_distort=1, method __call__ (line 226) | def __call__(self, img_group): method _sample_crop_size (line 243) | def _sample_crop_size(self, im_size): method _sample_fix_offset (line 272) | def _sample_fix_offset(self, image_w, image_h, crop_w, crop_h): method fill_fix_offset (line 278) | def fill_fix_offset(more_fix_crop, image_w, image_h, crop_w, crop_h): class GroupRandomSizedCrop (line 303) | class GroupRandomSizedCrop(object): method __init__ (line 311) | def __init__(self, size, interpolation=Image.BILINEAR): method __call__ (line 315) | def __call__(self, img_group): class ConvertDataFormat (line 353) | class ConvertDataFormat(object): method __init__ (line 354) | def __init__(self, model_type): method __call__ (line 357) | def __call__(self, images): class Stack (line 367) | class Stack(object): method __init__ (line 369) | def __init__(self, roll=False): method __call__ (line 372) | def __call__(self, img_group): class ToTorchFormatTensor (line 386) | class ToTorchFormatTensor(object): method __init__ (line 390) | def __init__(self, div=True): method __call__ (line 393) | def __call__(self, pic): class IdentityTransform (line 409) | class IdentityTransform(object): method __call__ (line 411) | def __call__(self, data): FILE: stllm/test/video_utils.py function load_video (line 11) | def load_video(vis_path, n_clips=1, num_frm=100): function load_video_rawframes (line 50) | def load_video_rawframes(vis_path, total_frame_num, n_clips=1, num_frm=1... function get_seq_frames (line 75) | def get_seq_frames(total_num_frames, desired_num_frames): function get_frames_from_raw (line 101) | def get_frames_from_raw(directory, frame_idx, filename_tmpl="{:0>6}.jpg"... FILE: stllm/train/stllm_trainer.py function maybe_zero_3 (line 29) | def maybe_zero_3(param, ignore_status=False, name=None): function get_mm_adapter_state_maybe_zero_3 (line 43) | def get_mm_adapter_state_maybe_zero_3(named_params, keys_to_match): function split_to_even_chunks (line 49) | def split_to_even_chunks(indices, lengths, num_chunks): function get_modality_length_grouped_indices (line 71) | def get_modality_length_grouped_indices(lengths, batch_size, world_size,... function get_length_grouped_indices (line 99) | def get_length_grouped_indices(lengths, batch_size, world_size, generato... class LengthGroupedSampler (line 110) | class LengthGroupedSampler(Sampler): method __init__ (line 116) | def __init__( method __len__ (line 133) | def __len__(self): method __iter__ (line 136) | def __iter__(self): class STLLMTrainer (line 144) | class STLLMTrainer(Trainer): method _get_train_sampler (line 146) | def _get_train_sampler(self) -> Optional[torch.utils.data.Sampler]: method get_train_dataloader (line 161) | def get_train_dataloader(self): method create_optimizer (line 218) | def create_optimizer(self): method compute_loss (line 307) | def compute_loss(self, model, inputs, return_outputs=False): FILE: stllm/train/train.py function parse_args (line 36) | def parse_args(): function setup_seeds (line 55) | def setup_seeds(config): function get_runner_class (line 66) | def get_runner_class(cfg): function main (line 75) | def main(): FILE: stllm/train/train_hf.py function rank0_print (line 51) | def rank0_print(*args): function parse_args (line 55) | def parse_args(): class ModelArguments (line 75) | class ModelArguments: class DataArguments (line 79) | class DataArguments: class TrainingArguments (line 84) | class TrainingArguments(transformers.TrainingArguments): function maybe_zero_3 (line 110) | def maybe_zero_3(param, ignore_status=False, name=None): function get_peft_state_maybe_zero_3 (line 125) | def get_peft_state_maybe_zero_3(named_params, bias): function get_peft_state_non_lora_maybe_zero_3 (line 150) | def get_peft_state_non_lora_maybe_zero_3(named_params, require_grad_only... function get_mm_adapter_state_maybe_zero_3 (line 158) | def get_mm_adapter_state_maybe_zero_3(named_params, keys_to_match): function find_all_linear_names (line 164) | def find_all_linear_names(model): function safe_save_model_for_hf_trainer (line 180) | def safe_save_model_for_hf_trainer(trainer: transformers.Trainer, function merge_dict_to_argv (line 205) | def merge_dict_to_argv(input_dict): class DefaultDataCollator (line 218) | class DefaultDataCollator(object): method __call__ (line 219) | def __call__(self, instances: Sequence[Dict]) -> Dict[str, torch.Tensor]: function train (line 222) | def train():