SYMBOL INDEX (572 symbols across 59 files) FILE: ferret/conversation.py class SeparatorStyle (line 8) | class SeparatorStyle(Enum): class Conversation (line 18) | class Conversation: method get_prompt (line 33) | def get_prompt(self): method append_message (line 110) | def append_message(self, role, message): method get_images (line 113) | def get_images(self, return_pil=False): method to_gradio_chatbot (line 168) | def to_gradio_chatbot(self): method copy (line 202) | def copy(self): method dict (line 213) | def dict(self): FILE: ferret/eval/eval_flickr_entities.py function resize_bbox (line 29) | def resize_bbox(box, image_w=None, image_h=None): function decode_bbox_from_caption (line 38) | def decode_bbox_from_caption(text, img_w, img_h, verbose=False): function are_phrases_similar (line 71) | def are_phrases_similar(phrase1, phrase2): function get_sentence_data (line 91) | def get_sentence_data(filename) -> List[Dict[str, Any]]: function get_annotations (line 159) | def get_annotations(filename) -> Dict[str, Union[int, List[str], Dict[st... function box_area (line 220) | def box_area(boxes: np.array) -> np.array: function _box_inter_union (line 239) | def _box_inter_union(boxes1: np.array, boxes2: np.array) -> Tuple[np.arr... function box_iou (line 254) | def box_iou(boxes1: np.array, boxes2: np.array) -> np.array: function _merge_boxes (line 275) | def _merge_boxes(boxes: List[List[int]]) -> List[List[int]]: class RecallTracker (line 287) | class RecallTracker: method __init__ (line 290) | def __init__(self, topk: Sequence[int]): method add_positive (line 299) | def add_positive(self, k: int, category: str): method add_negative (line 306) | def add_negative(self, k: int, category: str): method report (line 312) | def report(self) -> Dict[int, Dict[str, float]]: class Flickr30kEntitiesRecallEvaluator (line 325) | class Flickr30kEntitiesRecallEvaluator: method __init__ (line 326) | def __init__( method evaluate (line 391) | def evaluate(self, predictions: List[Dict]): class Flickr30kEntitiesRecallEvaluatorFromJsonl (line 461) | class Flickr30kEntitiesRecallEvaluatorFromJsonl(Flickr30kEntitiesRecallE... method evaluate (line 462) | def evaluate(self, method summarize (line 560) | def summarize(self): FILE: ferret/eval/eval_gpt_review_3newclass.py function get_eval (line 15) | def get_eval(content: str, max_tokens: int): function postprocess_answer (line 39) | def postprocess_answer(answer, category): function parse_score (line 64) | def parse_score(review): FILE: ferret/eval/eval_lvis.py function get_args (line 19) | def get_args(): function remove_not_phrases_v2 (line 24) | def remove_not_phrases_v2(text): FILE: ferret/eval/eval_pope.py function evaluate_pope (line 20) | def evaluate_pope(prediction_file, annotation_file): FILE: ferret/eval/eval_refexp.py function resize_bbox (line 29) | def resize_bbox(box, image_w=None, image_h=None): function decode_bbox_from_caption (line 38) | def decode_bbox_from_caption(text, img_w, img_h, verbose=False): function are_phrases_similar (line 71) | def are_phrases_similar(phrase1, phrase2): class RefExpEvaluatorFromJsonl (line 91) | class RefExpEvaluatorFromJsonl(object): method __init__ (line 92) | def __init__(self, refexp_gt_path, k=(1, -1), thresh_iou=0.5): method summarize (line 102) | def summarize(self, FILE: ferret/eval/model_flickr.py function split_list (line 48) | def split_list(lst, n): function get_chunk (line 54) | def get_chunk(lst, n, k): function plot_flickr (line 59) | def plot_flickr(img, boxes, entities, mode='pred'): function remove_punctuation (line 74) | def remove_punctuation(text: str) -> str: function resize_bbox (line 81) | def resize_bbox(box, image_w=None, image_h=None): function find_bbox_template (line 90) | def find_bbox_template(text, img_w, img_h): class FlickrGrounding (line 112) | class FlickrGrounding(torchvision.datasets.CocoDetection): method __init__ (line 113) | def __init__(self, img_folder, ann_file, transforms): method __getitem__ (line 118) | def __getitem__(self, idx): function eval_model_flickr (line 156) | def eval_model_flickr(args): FILE: ferret/eval/model_gpt4eval_3newclass.py function split_list (line 36) | def split_list(lst, n): function get_chunk (line 42) | def get_chunk(lst, n, k): function generate_mask_for_feature (line 47) | def generate_mask_for_feature(coor, raw_w, raw_h, mask=None): class GPTEval_Data (line 74) | class GPTEval_Data(): method __init__ (line 75) | def __init__(self, data_path, image_path, args) -> None: method ids (line 159) | def ids(self): method fetch_data (line 162) | def fetch_data(self, id): function eval_model (line 167) | def eval_model(args): FILE: ferret/eval/model_lvis.py function split_list (line 44) | def split_list(lst, n): function get_chunk (line 50) | def get_chunk(lst, n, k): function generate_mask_for_feature (line 55) | def generate_mask_for_feature(coor, raw_w, raw_h, mask=None): class LVISData_V1 (line 82) | class LVISData_V1(): method __init__ (line 83) | def __init__(self, data_path, image_path, args) -> None: method ids (line 156) | def ids(self): method fetch_data (line 159) | def fetch_data(self, id): function eval_model (line 164) | def eval_model(args): FILE: ferret/eval/model_point_cls_single_image.py function generate_mask_for_feature (line 39) | def generate_mask_for_feature(coor,raw_w, raw_h): function eval_model (line 59) | def eval_model(args): FILE: ferret/eval/model_pope.py function split_list (line 47) | def split_list(lst, n): function get_chunk (line 52) | def get_chunk(lst, n, k): function plot_pope (line 57) | def plot_pope(img, boxes, text): function resize_bbox (line 65) | def resize_bbox(box, image_w=None, image_h=None): function find_bbox_template_v3 (line 74) | def find_bbox_template_v3(text, img_w, img_h): class PopeGrounding (line 99) | class PopeGrounding(): method __init__ (line 100) | def __init__(self, img_folder, ann_file): method __getitem__ (line 107) | def __getitem__(self, idx): method ids (line 116) | def ids(self): function eval_model_pope (line 120) | def eval_model_pope(args): FILE: ferret/eval/model_refcoco.py function split_list (line 47) | def split_list(lst, n): function get_chunk (line 53) | def get_chunk(lst, n, k): function plot_refexp (line 58) | def plot_refexp(img, boxes, entities, mode='pred'): function remove_punctuation (line 70) | def remove_punctuation(text: str) -> str: function resize_bbox (line 77) | def resize_bbox(box, image_w=None, image_h=None): function find_bbox_template (line 86) | def find_bbox_template(text, img_w, img_h): class RefExpGrounding (line 115) | class RefExpGrounding(torchvision.datasets.CocoDetection): method __init__ (line 116) | def __init__(self, img_folder, ann_file, transforms): method __getitem__ (line 121) | def __getitem__(self, idx): function eval_model_refexp (line 149) | def eval_model_refexp(args): FILE: ferret/eval/summarize_gpt_review.py function parse_args (line 9) | def parse_args(): FILE: ferret/mm_utils.py function load_image_from_base64 (line 10) | def load_image_from_base64(image): function process_images (line 14) | def process_images(images, image_processor, model_cfg): function tokenizer_image_token (line 18) | def tokenizer_image_token(prompt, tokenizer, image_token_index=IMAGE_TOK... function get_model_name_from_path (line 40) | def get_model_name_from_path(model_path): class KeywordsStoppingCriteria (line 51) | class KeywordsStoppingCriteria(StoppingCriteria): method __init__ (line 52) | def __init__(self, keywords, tokenizer, input_ids): method __call__ (line 63) | def __call__(self, output_ids: torch.LongTensor, scores: torch.FloatTe... FILE: ferret/model/apply_delta.py function apply_delta (line 35) | def apply_delta(base_model_path, target_model_path, delta_path): FILE: ferret/model/builder.py function load_pretrained_model (line 24) | def load_pretrained_model(model_path, model_base, model_name, load_8bit=... FILE: ferret/model/consolidate.py function consolidate_ckpt (line 13) | def consolidate_ckpt(src_path, dst_path): FILE: ferret/model/ferret_arch.py function rand_sample (line 27) | def rand_sample(x, max_len): function rand_sample_repeat (line 34) | def rand_sample_repeat(x, max_len): function point_sample (line 45) | def point_sample(input, point_coords, return_dtype, **kwargs): function farthest_point_sample (line 73) | def farthest_point_sample(xyz, npoint): function index_points (line 96) | def index_points(points, idx): function square_distance (line 115) | def square_distance(src, dst): function knn_point (line 137) | def knn_point(nsample, xyz, new_xyz): class ConvReLULN1D (line 151) | class ConvReLULN1D(nn.Module): method __init__ (line 152) | def __init__(self, in_channels, out_channels, kernel_size=1, bias=True): method forward (line 161) | def forward(self, x): function normal_init (line 171) | def normal_init(module, mean=0, std=1, bias=0): class GeoRegionSampler (line 178) | class GeoRegionSampler(nn.Module): method __init__ (line 179) | def __init__(self, method norm_init_weights (line 215) | def norm_init_weights(self): method forward (line 221) | def forward(self, class FERRETMetaModel (line 333) | class FERRETMetaModel: method __init__ (line 335) | def __init__(self, config): method get_vision_tower (line 356) | def get_vision_tower(self): method initialize_vision_modules (line 362) | def initialize_vision_modules(self, model_args, fsdp=None, add_region_... class FERRETMetaForCausalLM (line 411) | class FERRETMetaForCausalLM(ABC): method get_model (line 414) | def get_model(self): method get_vision_tower (line 417) | def get_vision_tower(self): method encode_images (line 420) | def encode_images(self, images, region_flag=False, region_geo_sampler=... method extract_region_feature (line 435) | def extract_region_feature(self, region_feature_map, region_masks, ori... method prepare_inputs_labels_for_multimodal (line 471) | def prepare_inputs_labels_for_multimodal( method initialize_vision_tokenizer (line 626) | def initialize_vision_tokenizer(self, model_args, tokenizer, add_regio... FILE: ferret/model/language_model/ferret_llama.py class FERRETConfig (line 28) | class FERRETConfig(LlamaConfig): class FERRETLlamaModel (line 32) | class FERRETLlamaModel(FERRETMetaModel, LlamaModel): method __init__ (line 35) | def __init__(self, config: LlamaConfig): class FERRETLlamaForCausalLM (line 39) | class FERRETLlamaForCausalLM(LlamaForCausalLM, FERRETMetaForCausalLM): 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 116) | def prepare_inputs_for_generation( FILE: ferret/model/make_delta.py function make_delta (line 35) | def make_delta(base_model_path, target_model_path, delta_path, hub_repo_... FILE: ferret/model/multimodal_encoder/builder.py function build_vision_tower (line 5) | def build_vision_tower(vision_tower_cfg, **kwargs): FILE: ferret/model/multimodal_encoder/clip_encoder.py class CLIPImageProcessor_GIT (line 17) | class CLIPImageProcessor_GIT(CLIPImageProcessor): method resize (line 18) | def resize( class CLIPVisionTower (line 48) | class CLIPVisionTower(nn.Module): method __init__ (line 49) | def __init__(self, vision_tower, args, delay_load=False): method load_model (line 63) | def load_model(self, vision_tower_path=None): method feature_select (line 74) | def feature_select(self, image_forward_outs): method forward (line 85) | def forward(self, images): method dummy_feature (line 99) | def dummy_feature(self): method dtype (line 103) | def dtype(self): method device (line 107) | def device(self): method config (line 111) | def config(self): method hidden_size (line 118) | def hidden_size(self): method num_patches (line 122) | def num_patches(self): FILE: ferret/model/utils.py function auto_upgrade (line 4) | def auto_upgrade(config): FILE: ferret/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: ferret/serve/gradio_web_server.py function generate_mask_for_feature (line 53) | def generate_mask_for_feature(coor, raw_w, raw_h, mask=None): function draw_box (line 80) | def draw_box(coor, region_mask, region_ph, img, input_mode): function get_conv_log_filename (line 115) | def get_conv_log_filename(): function get_model_list (line 121) | def get_model_list(): function load_demo (line 141) | def load_demo(url_params, request: gr.Request): function load_demo_refresh_model_list (line 161) | def load_demo_refresh_model_list(request: gr.Request): function vote_last_response (line 175) | def vote_last_response(state, vote_type, model_selector, request: gr.Req... function upvote_last_response (line 187) | def upvote_last_response(state, model_selector, request: gr.Request): function downvote_last_response (line 193) | def downvote_last_response(state, model_selector, request: gr.Request): function flag_last_response (line 199) | def flag_last_response(state, model_selector, request: gr.Request): function regenerate (line 205) | def regenerate(state, image_process_mode, request: gr.Request): function clear_history (line 215) | def clear_history(request: gr.Request): function resize_bbox (line 222) | def resize_bbox(box, image_w=None, image_h=None, default_wh=VOCAB_IMAGE_W): function show_location (line 231) | def show_location(sketch_pad, chatbot): function add_text (line 274) | def add_text(state, text, image_process_mode, original_image, sketch_pad... function post_process_code (line 313) | def post_process_code(code): function find_indices_in_order (line 324) | def find_indices_in_order(str_list, STR): function format_region_prompt (line 337) | def format_region_prompt(prompt, refer_input_state): function http_bot (line 349) | def http_bot(state, model_selector, temperature, top_p, max_new_tokens, ... class ImageMask (line 519) | class ImageMask(gr.components.Image): method __init__ (line 526) | def __init__(self, **kwargs): method preprocess (line 529) | def preprocess(self, x): function draw (line 533) | def draw(input_mode, input, refer_input_state, refer_text_show, imagebox... function build_demo (line 611) | def build_demo(embed_mode): FILE: ferret/serve/model_worker.py function heart_beat_worker (line 44) | def heart_beat_worker(controller): class ModelWorker (line 51) | class ModelWorker: method __init__ (line 52) | def __init__(self, controller_addr, worker_addr, method register_to_controller (line 90) | def register_to_controller(self): method send_heart_beat (line 102) | def send_heart_beat(self): method get_queue_length (line 123) | def get_queue_length(self): method get_status (line 130) | def get_status(self): method generate_stream (line 138) | def generate_stream(self, params): method generate_stream_gate (line 268) | def generate_stream_gate(self, params): function release_model_semaphore (line 298) | def release_model_semaphore(fn=None): function generate_stream (line 305) | async def generate_stream(request: Request): function get_status (line 321) | async def get_status(request: Request): FILE: ferret/train/ferret_trainer.py function maybe_zero_3 (line 8) | def maybe_zero_3(param, ignore_status=False, name=None): function get_mm_adapter_state_maybe_zero_3 (line 22) | def get_mm_adapter_state_maybe_zero_3(named_params, keys_to_match): class FERRETTrainer (line 28) | class FERRETTrainer(Trainer): method _save_checkpoint (line 30) | def _save_checkpoint(self, model, trial, metrics=None): method _save (line 62) | def _save(self, output_dir: Optional[str] = None, state_dict=None): FILE: ferret/train/llama_flash_attn_monkey_patch.py function forward (line 15) | def forward( function _prepare_decoder_attention_mask (line 94) | def _prepare_decoder_attention_mask(self, attention_mask, input_shape, function replace_llama_attn_with_flash_attn (line 100) | def replace_llama_attn_with_flash_attn(): FILE: ferret/train/train.py function rank0_print (line 55) | def rank0_print(*args): class ModelArguments (line 61) | class ModelArguments: class DataArguments (line 80) | class DataArguments: class TrainingArguments (line 99) | class TrainingArguments(transformers.TrainingArguments): function maybe_zero_3 (line 132) | def maybe_zero_3(param, ignore_status=False, name=None): function get_peft_state_maybe_zero_3 (line 147) | def get_peft_state_maybe_zero_3(named_params, bias): function get_peft_state_non_lora_maybe_zero_3 (line 172) | def get_peft_state_non_lora_maybe_zero_3(named_params, require_grad_only... function get_mm_adapter_state_maybe_zero_3 (line 180) | def get_mm_adapter_state_maybe_zero_3(named_params, keys_to_match): function find_all_linear_names (line 186) | def find_all_linear_names(model): function safe_save_model_for_hf_trainer (line 200) | def safe_save_model_for_hf_trainer(trainer: transformers.Trainer, function smart_tokenizer_and_embedding_resize (line 255) | def smart_tokenizer_and_embedding_resize( function _tokenize_fn (line 280) | def _tokenize_fn(strings: Sequence[str], function _mask_targets (line 307) | def _mask_targets(target, tokenized_lens, speakers): function _add_speaker_and_signal (line 318) | def _add_speaker_and_signal(header, source, get_conversation=True): function preprocess_multimodal (line 339) | def preprocess_multimodal( function preprocess_llama_2 (line 366) | def preprocess_llama_2( function preprocess_v1 (line 448) | def preprocess_v1( function preprocess_plain (line 537) | def preprocess_plain( function preprocess (line 559) | def preprocess( function extend_list (line 610) | def extend_list(original_list, multiplier): function extract_coors (line 629) | def extract_coors(s): function regulate_box (line 651) | def regulate_box(box, img_w, img_h): class LazySupervisedDataset (line 655) | class LazySupervisedDataset(Dataset): method load_vg_object (line 658) | def load_vg_object(self, data_path, image_folder): method load_vg_yesno_object (line 666) | def load_vg_yesno_object(self, data_path, image_folder): method load_vg_attribute (line 674) | def load_vg_attribute(self, data_path, image_folder): method load_vg_relation (line 682) | def load_vg_relation(self, data_path, image_folder): method load_vg_region (line 690) | def load_vg_region(self, data_path, image_folder): method load_git_instruction (line 698) | def load_git_instruction(self, data_path, image_folder): method load_llava (line 706) | def load_llava(self, data_path, image_folder): method load_grounded_llava_boxes (line 713) | def load_grounded_llava_boxes(self, data_path, image_folder): method load_refexp (line 721) | def load_refexp(self, data_path, image_folder): method load_flickr (line 729) | def load_flickr(self, data_path, image_folder): method load_objects365 (line 737) | def load_objects365(self, data_path, image_folder): method load_cc3m (line 745) | def load_cc3m(self, data_path, image_folder): method __init__ (line 752) | def __init__(self, data_path: str, method __len__ (line 838) | def __len__(self): method get_obj_center (line 841) | def get_obj_center(self, box, ratio_w, ratio_h, std_dev_weight=0.15): method sample_point_in_segment (line 867) | def sample_point_in_segment(self, mask, ratio_w, ratio_h, box=None, sa... method get_bbox_coor (line 904) | def get_bbox_coor(self, box, ratio_w, ratio_h): method generate_mask_for_feature (line 908) | def generate_mask_for_feature(self, coor, box, mask, raw_w, raw_h): method __getitem__ (line 949) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: class DataCollatorForSupervisedDataset (line 1109) | class DataCollatorForSupervisedDataset(object): method __call__ (line 1114) | def __call__(self, instances: Sequence[Dict]) -> Dict[str, torch.Tensor]: function make_supervised_data_module (line 1146) | def make_supervised_data_module(tokenizer: transformers.PreTrainedTokeni... function train (line 1160) | def train(): FILE: ferret/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: ferretui/ferretui/conversation.py class SeparatorStyle (line 10) | class SeparatorStyle(Enum): class Conversation (line 21) | class Conversation: method get_prompt (line 34) | def get_prompt(self): method append_message (line 121) | def append_message(self, role, message): method get_images (line 124) | def get_images(self, return_pil=False): method to_gradio_chatbot (line 179) | def to_gradio_chatbot(self): method copy (line 213) | def copy(self): method dict (line 224) | def dict(self): FILE: ferretui/ferretui/eval/model_UI.py function split_list (line 21) | def split_list(lst, n): function get_chunk (line 26) | def get_chunk(lst, n, k): function generate_mask_for_feature (line 30) | def generate_mask_for_feature(coor, raw_w, raw_h, mask=None): function get_task_from_file (line 57) | def get_task_from_file(file): function get_bbox_coor (line 70) | def get_bbox_coor(box, ratio_w, ratio_h): function get_model_name_from_path (line 73) | def get_model_name_from_path(model_path): class UIData (line 81) | class UIData: method __init__ (line 82) | def __init__(self, data_path, image_path, args) -> None: method ids (line 90) | def ids(self): method __getitem__ (line 93) | def __getitem__(self, idx): function eval_model (line 129) | def eval_model(args): FILE: ferretui/ferretui/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: ferretui/ferretui/mm_utils.py function select_best_resolution (line 13) | def select_best_resolution(original_size, possible_resolutions): function resize_and_pad_image (line 43) | def resize_and_pad_image(image, target_resolution, is_pad=False): function divide_to_patches (line 79) | def divide_to_patches(image, patch_size): function get_anyres_image_grid_shape (line 101) | def get_anyres_image_grid_shape(image_size, grid_pinpoints, patch_size): function process_anyres_image (line 121) | def process_anyres_image(image, processor, grid_pinpoints, image_process... function load_image_from_base64 (line 160) | def load_image_from_base64(image): function expand2square (line 164) | def expand2square(pil_img, background_color): function process_images (line 178) | def process_images(images, image_processor, model_cfg, image_process_fun... function tokenizer_image_token (line 198) | def tokenizer_image_token(prompt, tokenizer, image_token_index=IMAGE_TOK... function get_model_name_from_path (line 220) | def get_model_name_from_path(model_path): class KeywordsStoppingCriteria (line 228) | class KeywordsStoppingCriteria(StoppingCriteria): method __init__ (line 229) | def __init__(self, keywords, tokenizer, input_ids): method call_for_batch (line 243) | def call_for_batch(self, output_ids: torch.LongTensor, scores: torch.F... method __call__ (line 256) | def __call__(self, output_ids: torch.LongTensor, scores: torch.FloatTe... FILE: ferretui/ferretui/model/apply_delta.py function apply_delta (line 13) | def apply_delta(base_model_path, target_model_path, delta_path): FILE: ferretui/ferretui/model/builder.py function load_pretrained_model (line 26) | def load_pretrained_model(model_path, model_base, model_name, use_safete... FILE: ferretui/ferretui/model/consolidate.py function consolidate_ckpt (line 13) | def consolidate_ckpt(src_path, dst_path): FILE: ferretui/ferretui/model/ferret_arch.py function rand_sample (line 36) | def rand_sample(x, max_len): function rand_sample_repeat (line 44) | def rand_sample_repeat(x, max_len): function point_sample (line 56) | def point_sample(input, point_coords, return_dtype, **kwargs): function farthest_point_sample (line 82) | def farthest_point_sample(xyz, npoint): function index_points (line 105) | def index_points(points, idx): function square_distance (line 124) | def square_distance(src, dst): function knn_point (line 146) | def knn_point(nsample, xyz, new_xyz): class ConvReLULN1D (line 160) | class ConvReLULN1D(nn.Module): method __init__ (line 161) | def __init__(self, in_channels, out_channels, kernel_size=1, bias=True): method forward (line 170) | def forward(self, x): function normal_init (line 180) | def normal_init(module, mean=0, std=1, bias=0): class GeoRegionSampler (line 187) | class GeoRegionSampler(nn.Module): method __init__ (line 188) | def __init__(self, method norm_init_weights (line 229) | def norm_init_weights(self): method forward (line 235) | def forward(self, class FerretMetaModel (line 343) | class FerretMetaModel: method __init__ (line 345) | def __init__(self, config): method get_vision_tower (line 378) | def get_vision_tower(self): method initialize_vision_modules (line 384) | def initialize_vision_modules(self, model_args, fsdp=None, function unpad_image (line 477) | def unpad_image(tensor, original_size): class FerretMetaForCausalLM (line 508) | class FerretMetaForCausalLM(ABC): method get_model (line 511) | def get_model(self): method get_vision_tower (line 514) | def get_vision_tower(self): method encode_images (line 517) | def encode_images(self, images, region_flag=False, region_geo_sampler=... method extract_region_feature (line 530) | def extract_region_feature(self, region_feature_map, region_masks, ori... method prepare_inputs_labels_for_multimodal (line 565) | def prepare_inputs_labels_for_multimodal( method initialize_vision_tokenizer (line 873) | def initialize_vision_tokenizer(self, model_args, tokenizer, add_regio... FILE: ferretui/ferretui/model/language_model/ferret_gemma.py class FerretGemmaConfig (line 34) | class FerretGemmaConfig(GemmaConfig): class FerretGemmaModel (line 38) | class FerretGemmaModel(FerretMetaModel, GemmaModel): method __init__ (line 41) | def __init__(self, config: GemmaConfig): class FerretGemmaForCausalLM (line 45) | class FerretGemmaForCausalLM(GemmaForCausalLM, FerretMetaForCausalLM): method __init__ (line 48) | def __init__(self, config): method get_model (line 57) | def get_model(self): method forward (line 60) | def forward( method generate (line 114) | def generate( method prepare_inputs_for_generation (line 155) | def prepare_inputs_for_generation(self, input_ids, past_key_values=Non... FILE: ferretui/ferretui/model/language_model/ferret_llama.py class FerretConfig (line 30) | class FerretConfig(LlamaConfig): class FerretLlamaModel (line 34) | class FerretLlamaModel(FerretMetaModel, LlamaModel): method __init__ (line 37) | def __init__(self, config: LlamaConfig): class FerretLlamaForCausalLM (line 41) | class FerretLlamaForCausalLM(LlamaForCausalLM, FerretMetaForCausalLM): 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 109) | def generate( method prepare_inputs_for_generation (line 150) | def prepare_inputs_for_generation(self, input_ids, past_key_values=None, FILE: ferretui/ferretui/model/language_model/ferret_mpt.py class FerretMptConfig (line 25) | class FerretMptConfig(MptConfig): class FerretMptModel (line 29) | class FerretMptModel(FerretMetaModel, MptModel): method __init__ (line 32) | def __init__(self, config: MptConfig): method embed_tokens (line 36) | def embed_tokens(self, x): class FerretMptForCausalLM (line 40) | class FerretMptForCausalLM(MptForCausalLM, FerretMetaForCausalLM): 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: ferretui/ferretui/model/make_delta.py function make_delta (line 13) | def make_delta(base_model_path, target_model_path, delta_path, hub_repo_... FILE: ferretui/ferretui/model/multimodal_encoder/builder.py function build_vision_tower (line 5) | def build_vision_tower(vision_tower_cfg, **kwargs): FILE: ferretui/ferretui/model/multimodal_encoder/clip_encoder.py class CLIPImageProcessor_Ferret (line 19) | class CLIPImageProcessor_Ferret(CLIPImageProcessor): method resize (line 20) | def resize( class CLIPVisionTower (line 50) | class CLIPVisionTower(nn.Module): method __init__ (line 51) | def __init__(self, vision_tower, args, delay_load=False): method load_model (line 68) | def load_model(self, device_map=None): method feature_select (line 83) | def feature_select(self, image_forward_outs): method forward (line 94) | def forward(self, images): method dummy_feature (line 108) | def dummy_feature(self): method dtype (line 112) | def dtype(self): method device (line 116) | def device(self): method config (line 120) | def config(self): method hidden_size (line 127) | def hidden_size(self): method num_patches_per_side (line 131) | def num_patches_per_side(self): method num_patches (line 135) | def num_patches(self): class CLIPVisionTowerS2 (line 140) | class CLIPVisionTowerS2(CLIPVisionTower): method __init__ (line 141) | def __init__(self, vision_tower, args, delay_load=False): method load_model (line 161) | def load_model(self, device_map=None): method forward_feature (line 176) | def forward_feature(self, images): method forward (line 182) | def forward(self, images): method hidden_size (line 194) | def hidden_size(self): FILE: ferretui/ferretui/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: ferretui/ferretui/model/utils.py function auto_upgrade (line 4) | def auto_upgrade(config): FILE: ferretui/ferretui/serve/cli.py function load_image (line 18) | def load_image(image_file): function main (line 27) | def main(args): FILE: ferretui/ferretui/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: ferretui/ferretui/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: ferretui/ferretui/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: ferretui/ferretui/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: ferretui/ferretui/serve/test_message.py function main (line 9) | def main(): FILE: ferretui/ferretui/train/ferret_trainer.py function get_vision_tower_state_maybe_zero_3 (line 19) | def get_vision_tower_state_maybe_zero_3(named_params, keys_to_match=['']): function maybe_zero_3 (line 26) | def maybe_zero_3(param, ignore_status=False, name=None): function get_mm_adapter_state_maybe_zero_3 (line 40) | def get_mm_adapter_state_maybe_zero_3(named_params, keys_to_match): function split_to_even_chunks (line 46) | def split_to_even_chunks(indices, lengths, num_chunks): function get_modality_length_grouped_indices (line 68) | def get_modality_length_grouped_indices(lengths, batch_size, world_size,... function get_length_grouped_indices (line 97) | def get_length_grouped_indices(lengths, batch_size, world_size, generato... class LengthGroupedSampler (line 108) | class LengthGroupedSampler(Sampler): method __init__ (line 114) | def __init__( method __len__ (line 131) | def __len__(self): method __iter__ (line 134) | def __iter__(self): class FerretTrainer (line 141) | class FerretTrainer(Trainer): method _get_train_sampler (line 142) | def _get_train_sampler(self) -> Optional[torch.utils.data.Sampler]: method create_optimizer (line 157) | def create_optimizer(self): method _save_checkpoint (line 283) | def _save_checkpoint(self, model, trial, metrics=None): method _save (line 306) | def _save(self, output_dir: Optional[str] = None, state_dict=None): FILE: ferretui/ferretui/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: ferretui/ferretui/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: ferretui/ferretui/train/train.py function rank0_print (line 56) | def rank0_print(*args): class ModelArguments (line 66) | class ModelArguments: class DataArguments (line 87) | class DataArguments: class TrainingArguments (line 104) | class TrainingArguments(transformers.TrainingArguments): function maybe_zero_3 (line 145) | def maybe_zero_3(param, ignore_status=False, name=None): function get_peft_state_maybe_zero_3 (line 161) | def get_peft_state_maybe_zero_3(named_params, bias): function get_peft_state_non_lora_maybe_zero_3 (line 188) | def get_peft_state_non_lora_maybe_zero_3(named_params, require_grad_only... function get_mm_adapter_state_maybe_zero_3 (line 197) | def get_mm_adapter_state_maybe_zero_3(named_params, keys_to_match): function get_vision_tower_state_maybe_zero_3 (line 205) | def get_vision_tower_state_maybe_zero_3(named_params, keys_to_match=['']): function find_all_linear_names (line 213) | def find_all_linear_names(model, qv_proj_only=False): function safe_save_model_for_hf_trainer (line 232) | def safe_save_model_for_hf_trainer(trainer: transformers.Trainer, function smart_tokenizer_and_embedding_resize (line 275) | def smart_tokenizer_and_embedding_resize( function _tokenize_fn (line 300) | def _tokenize_fn(strings: Sequence[str], function _mask_targets (line 327) | def _mask_targets(target, tokenized_lens, speakers): function _add_speaker_and_signal (line 338) | def _add_speaker_and_signal(header, source, get_conversation=True): function preprocess_multimodal (line 359) | def preprocess_multimodal( function preprocess_llama_2 (line 387) | def preprocess_llama_2( function preprocess_llama3 (line 471) | def preprocess_llama3( function preprocess_v1 (line 561) | def preprocess_v1( function preprocess_gemma (line 649) | def preprocess_gemma( function preprocess_phi3 (line 731) | def preprocess_phi3( function preprocess_mpt (line 826) | def preprocess_mpt( function preprocess_plain (line 917) | def preprocess_plain( function preprocess (line 942) | def preprocess( function extend_list (line 1001) | def extend_list(original_list, multiplier): function extract_coors (line 1020) | def extract_coors(s): function regulate_box (line 1043) | def regulate_box(box, img_w, img_h): class LazySupervisedDataset (line 1046) | class LazySupervisedDataset(Dataset): method shard_data (line 1049) | def shard_data(self, datas, data_path, ori_counts): method load_pretrain (line 1055) | def load_pretrain(self, data_path, image_folder): method load_llava_mixed (line 1065) | def load_llava_mixed(self, data_path, image_folder): method load_git_instruction (line 1077) | def load_git_instruction(self, data_path, image_folder): method load_vg_element (line 1088) | def load_vg_element(self, data_path, image_folder): method load_llava_grounded (line 1099) | def load_llava_grounded(self, data_path, image_folder): method load_flickr (line 1110) | def load_flickr(self, data_path, image_folder): method load_refexp (line 1121) | def load_refexp(self, data_path, image_folder): method load_obj365 (line 1132) | def load_obj365(self, data_path, image_folder): method load_sharegpt4v (line 1143) | def load_sharegpt4v(self, data_path, image_folder): method load_lvisinstruct4v (line 1154) | def load_lvisinstruct4v(self, data_path, image_folder): method load_vqa (line 1166) | def load_vqa(self, data_path, image_folder): method load_swit (line 1176) | def load_swit(self, data_path, image_folder): method load_sharegpt (line 1186) | def load_sharegpt(self, data_path): method load_screen2words (line 1195) | def load_screen2words(self, data_path, image_folder): method load_widgetcaptions (line 1205) | def load_widgetcaptions(self, data_path, image_folder): method load_taperception (line 1216) | def load_taperception(self, data_path, image_folder): method load_widget_listing (line 1227) | def load_widget_listing(self, data_path, image_folder): method load_ocr (line 1238) | def load_ocr(self, data_path, image_folder): method load_find_text (line 1249) | def load_find_text(self, data_path, image_folder): method load_icon_recognition (line 1260) | def load_icon_recognition(self, data_path, image_folder): method load_find_icons (line 1271) | def load_find_icons(self, data_path, image_folder): method load_widget_classification (line 1282) | def load_widget_classification(self, data_path, image_folder): method load_find_widget (line 1293) | def load_find_widget(self, data_path, image_folder): method load_detailed_description (line 1304) | def load_detailed_description(self, data_path, image_folder): method load_conversation_perception (line 1314) | def load_conversation_perception(self, data_path, image_folder): method load_conversation_interaction (line 1324) | def load_conversation_interaction(self, data_path, image_folder): method load_function (line 1335) | def load_function(self, data_path, image_folder): method __init__ (line 1345) | def __init__(self, data_path: str, method __len__ (line 1510) | def __len__(self): method sync_iter_counts (line 1513) | def sync_iter_counts(self): method get_obj_center (line 1530) | def get_obj_center(self, box, ratio_w, ratio_h, std_dev_weight=0.15): method sample_point_in_segment (line 1556) | def sample_point_in_segment(self, mask, ratio_w, ratio_h, box=None, sa... method get_bbox_coor (line 1592) | def get_bbox_coor(self, box, ratio_w, ratio_h): method generate_mask_for_feature (line 1595) | def generate_mask_for_feature(self, coor, box, mask, raw_w, raw_h): method lengths (line 1637) | def lengths(self): method modality_lengths (line 1646) | def modality_lengths(self): method format_unicode_filenames (line 1656) | def format_unicode_filenames(filename): method __getitem__ (line 1662) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: class DataCollatorForSupervisedDataset (line 1857) | class DataCollatorForSupervisedDataset(object): method __call__ (line 1862) | def __call__(self, instances: Sequence[Dict]) -> Dict[str, torch.Tensor]: function make_supervised_data_module (line 1896) | def make_supervised_data_module(tokenizer: transformers.PreTrainedTokeni... function unfreeze_vit (line 1910) | def unfreeze_vit(vision_tower): function format_bytes (line 1915) | def format_bytes(size): function train (line 1927) | def train(attn_implementation=None): function init_distributed_mode (line 2222) | def init_distributed_mode(): FILE: ferretui/ferretui/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: scripts/extract_geosampler_and_mm_projector.py function parse_args (line 39) | def parse_args(): FILE: scripts/verify_equal.py function verify_equal (line 15) | def verify_equal(old_model_path, new_model_path):