SYMBOL INDEX (546 symbols across 55 files) FILE: 4G_memory_rag/langchain_demo.py function clean_text (line 68) | def clean_text(text): class MiniCPM_LLM (line 90) | class MiniCPM_LLM(LLM): method __init__ (line 94) | def __init__(self, model_path: str): method _call (line 121) | def _call(self, prompt, stop: Optional[List[str]] = None): method _llm_type (line 178) | def _llm_type(self) -> str: function load_documents (line 183) | def load_documents(file_paths): function load_models (line 213) | def load_models(): function embed_documents (line 237) | def embed_documents(documents, embedding_models): function create_prompt_template (line 256) | def create_prompt_template(): function create_rag_chain (line 276) | def create_rag_chain(llm, prompt): function analysis_links (line 282) | def analysis_links(docs): function main (line 309) | def main(): function process_query (line 337) | def process_query(file, query): FILE: MiniCPM-o-long_video_inference/infer.py function extract_frames_and_audio (line 22) | def extract_frames_and_audio(video_path, sample_fps=2, max_frames=None, ... class LongVideoAudioProcessor (line 72) | class LongVideoAudioProcessor: method __init__ (line 73) | def __init__(self, method preprocess_frame (line 117) | def preprocess_frame(self, frame): method update_memory_bank (line 133) | def update_memory_bank(self, frames, audio_segments, current_time): method calculate_time_weights (line 153) | def calculate_time_weights(self, current_time): method weighted_sampling (line 164) | def weighted_sampling(self, frames, weights, sample_count): method update_text_summary (line 172) | def update_text_summary(self, new_summary): method process_long_video (line 179) | def process_long_video(self, video_path, query): method _inference_with_memory (line 224) | def _inference_with_memory(self, frames, audio_segments, query, chunk_... method _merge_results (line 339) | def _merge_results(self, all_results, query): class AudioProcessor (line 396) | class AudioProcessor: method __init__ (line 397) | def __init__(self, sample_rate=16000): method extract_audio_from_video (line 400) | def extract_audio_from_video(self, video_path): method segment_audio (line 409) | def segment_audio(self, audio, duration, segment_duration=1.0): method extract_audio_features (line 426) | def extract_audio_features(self, audio_segment): function main (line 432) | def main(): FILE: MiniCPMV2_6_awq/modeling_minicpmv.py class MiniCPMVPreTrainedModel (line 17) | class MiniCPMVPreTrainedModel(Qwen2PreTrainedModel): class MiniCPMV (line 21) | class MiniCPMV(MiniCPMVPreTrainedModel): method __init__ (line 22) | def __init__(self, config): method init_vision_module (line 33) | def init_vision_module(self): method init_resampler (line 49) | def init_resampler(self, embed_dim, vision_dim): method get_input_embeddings (line 58) | def get_input_embeddings(self): method set_input_embeddings (line 61) | def set_input_embeddings(self, value): method get_output_embeddings (line 64) | def get_output_embeddings(self): method set_output_embeddings (line 67) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 70) | def set_decoder(self, decoder): method prepare_inputs_for_generation (line 73) | def prepare_inputs_for_generation( method get_decoder (line 121) | def get_decoder(self): method get_vllm_embedding (line 124) | def get_vllm_embedding(self, data): method forward (line 217) | def forward(self, data, **kwargs): method _decode (line 236) | def _decode(self, inputs_embeds, tokenizer, attention_mask, decode_tex... method _decode_stream (line 249) | def _decode_stream(self, inputs_embeds, tokenizer, **kwargs): method _decode_text (line 265) | def _decode_text(self, result_ids, tokenizer): method generate (line 277) | def generate( method chat (line 321) | def chat( FILE: MiniCPMV2_6_awq/quantize.py function copy_files_not_in_B (line 18) | def copy_files_not_in_B(A_path, B_path): function load_alpaca (line 46) | def load_alpaca(): function load_wikitext (line 58) | def load_wikitext(): FILE: OCR_Multimodal_Search/finetune/dataset.py class SupervisedDataset (line 43) | class SupervisedDataset(Dataset): method __init__ (line 46) | def __init__( method __len__ (line 67) | def __len__(self): method __getitem__ (line 70) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: function data_collator (line 107) | def data_collator(examples, padding_value=0, max_length=2048): function conversation_to_ids (line 150) | def conversation_to_ids(conversation, tokenizer, llm_type=None, new_sche... function conversation_to_ids_minicpm (line 215) | def conversation_to_ids_minicpm(conversation, tokenizer): function conversation_to_ids_llama3 (line 247) | def conversation_to_ids_llama3(conversation, tokenizer): function conversation_to_ids_qwen2 (line 287) | def conversation_to_ids_qwen2(conversation, tokenizer): function preprocess (line 327) | def preprocess( function slice_image (line 414) | def slice_image( function ensure_divide (line 473) | def ensure_divide(length, patch_size): function find_best_resize (line 477) | def find_best_resize(original_size, scale_resolution, patch_size, allow_... function get_refine_size (line 488) | def get_refine_size( function split_to_patches (line 512) | def split_to_patches(image, grid): function get_grid_placeholder (line 529) | def get_grid_placeholder(tokenizer, grid, query_num, new_schema=False): function reshape_by_patch (line 550) | def reshape_by_patch(image_tensor, patch_size): FILE: OCR_Multimodal_Search/finetune/dataset_original.py class SupervisedDataset (line 18) | class SupervisedDataset(Dataset): method __init__ (line 21) | def __init__( method __len__ (line 42) | def __len__(self): method __getitem__ (line 45) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: function data_collator (line 70) | def data_collator(examples, padding_value=0, max_length=2048): function conversation_to_ids (line 108) | def conversation_to_ids(conversation, tokenizer, llm_type=None, new_sche... function conversation_to_ids_minicpm (line 173) | def conversation_to_ids_minicpm(conversation, tokenizer): function conversation_to_ids_llama3 (line 205) | def conversation_to_ids_llama3(conversation, tokenizer): function conversation_to_ids_qwen2 (line 245) | def conversation_to_ids_qwen2(conversation, tokenizer): function preprocess (line 285) | def preprocess( function slice_image (line 372) | def slice_image( function ensure_divide (line 431) | def ensure_divide(length, patch_size): function find_best_resize (line 435) | def find_best_resize(original_size, scale_resolution, patch_size, allow_... function get_refine_size (line 446) | def get_refine_size( function split_to_patches (line 470) | def split_to_patches(image, grid): function get_grid_placeholder (line 487) | def get_grid_placeholder(tokenizer, grid, query_num, new_schema=False): function reshape_by_patch (line 508) | def reshape_by_patch(image_tensor, patch_size): FILE: OCR_Multimodal_Search/finetune/finetune.py class ModelArguments (line 30) | class ModelArguments: class DataArguments (line 35) | class DataArguments: class TrainingArguments (line 45) | class TrainingArguments(transformers.TrainingArguments): class LoraArguments (line 66) | class LoraArguments: function rank0_print (line 80) | def rank0_print(*args): function safe_save_model_for_hf_trainer (line 85) | def safe_save_model_for_hf_trainer(trainer, output_dir: str, bias="none"): function make_supervised_data_module (line 91) | def make_supervised_data_module( function build_transform (line 142) | def build_transform(): function get_parameter_number (line 154) | def get_parameter_number(model): function train (line 172) | def train(): FILE: OCR_Multimodal_Search/finetune/trainer.py class CPMTrainer (line 41) | class CPMTrainer(Trainer): method original_loss (line 42) | def original_loss(self, model, inputs, return_outputs=False): method coloss (line 73) | def coloss(self, query_embeddings, doc_embeddings): method compute_loss (line 104) | def compute_loss(self,model, inputs): method prediction_step (line 165) | def prediction_step( method training_step (line 273) | def training_step(self, model: nn.Module, inputs: Dict[str, Union[torc... method _save (line 315) | def _save(self, output_dir: Optional[str] = None, state_dict=None): FILE: OCR_Multimodal_Search/infer/app.py function search (line 17) | def search(query: str, ds, images): function index (line 39) | def index(file, ds): FILE: OCR_Multimodal_Search/infer/cli_demo.py function search (line 15) | def search(query: str, ds, images): function index (line 38) | def index(file): FILE: OCR_Multimodal_Search/infer/dataset.py class ImageDataset (line 19) | class ImageDataset(Dataset): method __init__ (line 21) | def __init__( method __len__ (line 42) | def __len__(self): method __getitem__ (line 45) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: class QueryDataset (line 72) | class QueryDataset(Dataset): method __init__ (line 75) | def __init__( method __len__ (line 86) | def __len__(self): method __getitem__ (line 89) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: function data_collator_query (line 103) | def data_collator_query(examples, padding_value=0, max_length=2048): function data_collator (line 113) | def data_collator(examples, padding_value=0, max_length=2048,device='cpu'): function load_from_pdf (line 150) | def load_from_pdf(pdf_path: str): function load_from_json (line 155) | def load_from_json(json_path: str): function conversation_to_ids (line 161) | def conversation_to_ids(conversation, tokenizer, llm_type=None, new_sche... function conversation_to_ids_minicpm (line 226) | def conversation_to_ids_minicpm(conversation, tokenizer): function conversation_to_ids_llama3 (line 258) | def conversation_to_ids_llama3(conversation, tokenizer): function conversation_to_ids_qwen2 (line 298) | def conversation_to_ids_qwen2(conversation, tokenizer): function preprocess (line 338) | def preprocess( function slice_image (line 434) | def slice_image( function ensure_divide (line 493) | def ensure_divide(length, patch_size): function find_best_resize (line 497) | def find_best_resize(original_size, scale_resolution, patch_size, allow_... function get_refine_size (line 508) | def get_refine_size( function split_to_patches (line 532) | def split_to_patches(image, grid): function get_grid_placeholder (line 549) | def get_grid_placeholder(tokenizer, grid, query_num, new_schema=False): function reshape_by_patch (line 570) | def reshape_by_patch(image_tensor, patch_size): FILE: OCR_Multimodal_Search/infer/inference.py function main (line 12) | def main() -> None: FILE: OCR_Multimodal_Search/infer/utils.py function evaluate_colbert (line 4) | def evaluate_colbert( qs, ps, batch_size=128) -> torch.Tensor: function build_transform (line 22) | def build_transform(): FILE: OCR_VG/chat.py function init_omni_lmm (line 21) | def init_omni_lmm(model_path): function expand_question_into_multimodal (line 61) | def expand_question_into_multimodal(question_text, image_token_len, im_s... function wrap_question_for_omni_lmm (line 70) | def wrap_question_for_omni_lmm(question, image_token_len, tokenizer): class OmniLMM12B (line 85) | class OmniLMM12B: method __init__ (line 86) | def __init__(self, model_path) -> None: method decode (line 94) | def decode(self, image, input_ids): method chat (line 115) | def chat(self, input): function img2base64 (line 133) | def img2base64(file_name): class MiniCPMV (line 138) | class MiniCPMV: method __init__ (line 139) | def __init__(self, model_path) -> None: method chat (line 144) | def chat(self, input): class MiniCPMV2_5 (line 162) | class MiniCPMV2_5: method __init__ (line 163) | def __init__(self, model_path) -> None: method chat (line 168) | def chat(self, input): class MiniCPMVChat (line 186) | class MiniCPMVChat: method __init__ (line 187) | def __init__(self, model_path) -> None: method chat (line 195) | def chat(self, input): FILE: OCR_VG/gt_test.py function parse_text (line 11) | def parse_text(input_str): function cv2ImgAddText (line 25) | def cv2ImgAddText(img, text, left, top, textColor=(0, 255, 0), textSize=... function draw (line 38) | def draw(final_box,final_text,img,height,width): function get_pic_path (line 56) | def get_pic_path(dir): FILE: OCR_VG/merge_box.py function cv2ImgAddText (line 15) | def cv2ImgAddText(img, text, left, top, textColor=(0, 255, 0), textSize=... function calculate_intersection_percentage (line 31) | def calculate_intersection_percentage(rect1, rect2): function get_threshold (line 70) | def get_threshold(boxes, text_list, width, height): function find_min_bounding_rectangle (line 101) | def find_min_bounding_rectangle(polygons,four_pint=False): function merge_boxes (line 133) | def merge_boxes(boxes, text_list, width, height): function calculate_angle (line 184) | def calculate_angle(v1, v2): function is_quadrilateral_angles_in_range (line 193) | def is_quadrilateral_angles_in_range(points): function is_rectangle (line 204) | def is_rectangle(points): function get_query_answer (line 221) | def get_query_answer(boxes, text_list, height, width): function load_json (line 262) | def load_json(file_path): function draw (line 267) | def draw(final_box,final_text,img): function save_to_json (line 288) | def save_to_json(output_data, output_path): function main (line 300) | def main(): FILE: OCR_VG/omnilmm/conversation.py class SeparatorStyle (line 6) | class SeparatorStyle(Enum): class Conversation (line 13) | class Conversation: method get_prompt (line 26) | def get_prompt(self): method append_message (line 51) | def append_message(self, role, message): method get_images (line 54) | def get_images(self, return_pil=False): method to_gradio_chatbot (line 110) | def to_gradio_chatbot(self): method copy (line 142) | def copy(self): method dict (line 152) | def dict(self): FILE: OCR_VG/omnilmm/model/omnilmm.py class OmniLMMConfig (line 23) | class OmniLMMConfig(MistralConfig): class Identity (line 27) | class Identity(torch.nn.Identity): method forward (line 28) | def forward(self, input: Tensor, **kwargs) -> Tensor: function create_vision_module (line 32) | def create_vision_module(config): class OmniLMMModel (line 56) | class OmniLMMModel(MistralModel): method __init__ (line 59) | def __init__(self, config: OmniLMMConfig, mm_vision_tower=None, mm_hid... method initialize_vision_modules (line 75) | def initialize_vision_modules(self, vision_tower, no_randaug, num_quer... method get_vision_embedding (line 108) | def get_vision_embedding(self, pixel_values): method get_vllm_embedding (line 123) | def get_vllm_embedding(self, data): method forward (line 184) | def forward( class OmniLMMForCausalLM (line 269) | class OmniLMMForCausalLM(MistralForCausalLM): method __init__ (line 272) | def __init__(self, config, mm_vision_tower=None, tune_clip=True): method forward (line 283) | def forward( method prepare_inputs_for_generation (line 350) | def prepare_inputs_for_generation( method generate_vllm (line 372) | def generate_vllm( method initialize_vision_tokenizer (line 400) | def initialize_vision_tokenizer(self, mm_use_im_start_end, tokenizer, ... FILE: OCR_VG/omnilmm/model/resampler.py function get_abs_pos (line 23) | def get_abs_pos(abs_pos, tgt_size): function get_2d_sincos_pos_embed (line 43) | def get_2d_sincos_pos_embed(embed_dim, grid_size, cls_token=False): function get_2d_sincos_pos_embed_from_grid (line 62) | def get_2d_sincos_pos_embed_from_grid(embed_dim, grid): function get_1d_sincos_pos_embed_from_grid (line 75) | def get_1d_sincos_pos_embed_from_grid(embed_dim, pos): class Resampler (line 96) | class Resampler(nn.Module): method __init__ (line 104) | def __init__( method _init_weights (line 140) | def _init_weights(self, m): method forward (line 149) | def forward(self, x, attn_mask=None): method _repeat (line 170) | def _repeat(self, query, N: int): FILE: OCR_VG/omnilmm/model/utils.py function auto_upgrade (line 23) | def auto_upgrade(config): class KeywordsStoppingCriteria (line 42) | class KeywordsStoppingCriteria(StoppingCriteria): method __init__ (line 43) | def __init__(self, keywords, tokenizer, input_ids): method __call__ (line 49) | def __call__(self, output_ids: torch.LongTensor, scores: torch.FloatTe... function auto_upgrade (line 61) | def auto_upgrade(config): function identity_func (line 82) | def identity_func(img): function autocontrast_func (line 86) | def autocontrast_func(img, cutoff=0): function equalize_func (line 118) | def equalize_func(img): function rotate_func (line 142) | def rotate_func(img, degree, fill=(0, 0, 0)): function solarize_func (line 153) | def solarize_func(img, thresh=128): function color_func (line 163) | def color_func(img, factor): function contrast_func (line 185) | def contrast_func(img, factor): function brightness_func (line 198) | def brightness_func(img, factor): function sharpness_func (line 208) | def sharpness_func(img, factor): function shear_x_func (line 230) | def shear_x_func(img, factor, fill=(0, 0, 0)): function translate_x_func (line 238) | def translate_x_func(img, offset, fill=(0, 0, 0)): function translate_y_func (line 249) | def translate_y_func(img, offset, fill=(0, 0, 0)): function posterize_func (line 260) | def posterize_func(img, bits): function shear_y_func (line 268) | def shear_y_func(img, factor, fill=(0, 0, 0)): function cutout_func (line 276) | def cutout_func(img, pad_size, replace=(0, 0, 0)): function enhance_level_to_args (line 290) | def enhance_level_to_args(MAX_LEVEL): function shear_level_to_args (line 296) | def shear_level_to_args(MAX_LEVEL, replace_value): function translate_level_to_args (line 306) | def translate_level_to_args(translate_const, MAX_LEVEL, replace_value): function cutout_level_to_args (line 316) | def cutout_level_to_args(cutout_const, MAX_LEVEL, replace_value): function solarize_level_to_args (line 324) | def solarize_level_to_args(MAX_LEVEL): function none_level_to_args (line 331) | def none_level_to_args(level): function posterize_level_to_args (line 335) | def posterize_level_to_args(MAX_LEVEL): function rotate_level_to_args (line 342) | def rotate_level_to_args(MAX_LEVEL, replace_value): class RandomAugment (line 394) | class RandomAugment(object): method __init__ (line 396) | def __init__(self, N=2, M=10, isPIL=False, augs=[]): method get_random_ops (line 405) | def get_random_ops(self): method __call__ (line 409) | def __call__(self, img): function build_transform (line 421) | def build_transform(is_train, randaug=True, input_size=224, interpolatio... function img2b64 (line 465) | def img2b64(img_path): function str2b64 (line 475) | def str2b64(str): function b642str (line 479) | def b642str(b64): function is_dist_avail_and_initialized (line 483) | def is_dist_avail_and_initialized(): function get_world_size (line 491) | def get_world_size(): function get_rank (line 497) | def get_rank(): function all_gather (line 503) | def all_gather(data): function mean (line 546) | def mean(lst): function stop_gradient_by_name (line 550) | def stop_gradient_by_name(name: str): FILE: OCR_VG/omnilmm/train/train_utils.py function _tokenize_fn (line 22) | def _tokenize_fn(strings: Sequence[str], function omni_preprocess (line 50) | def omni_preprocess(sources, FILE: OCR_VG/omnilmm/utils.py function build_logger (line 17) | def build_logger(logger_name, logger_filename): class StreamToLogger (line 60) | class StreamToLogger(object): method __init__ (line 65) | def __init__(self, logger, log_level=logging.INFO): method __getattr__ (line 71) | def __getattr__(self, attr): method write (line 74) | def write(self, buf): method flush (line 88) | def flush(self): function disable_torch_init (line 94) | def disable_torch_init(): function violates_moderation (line 103) | def violates_moderation(text): function pretty_print_semaphore (line 124) | def pretty_print_semaphore(semaphore): FILE: agent_auto_plan/autoplan/all_param_inference.py function format_outputs (line 12) | def format_outputs(outputs): function all_param_split_task (line 22) | def all_param_split_task(question,tokenizer,merge_model): function stopping_criteria (line 63) | def stopping_criteria(cur_len,output_so_far): FILE: agent_auto_plan/autoplan/bing_search.py class SearchResult (line 24) | class SearchResult: method __init__ (line 25) | def __init__(self, title, url, snip) -> None: method dump (line 30) | def dump(self): method __str__ (line 37) | def __str__(self) -> str: class SearcherInterface (line 40) | class SearcherInterface: method search (line 41) | def search(self, query) -> List[SearchResult]: function generate_document (line 45) | def generate_document(url): function summarize_document (line 55) | def summarize_document(url, model_name): function fetch_webpage_content (line 67) | def fetch_webpage_content(url): function summarize_text (line 72) | def summarize_text(text,question,model,tokenizer): class Searcher (line 95) | class Searcher(SearcherInterface): method __init__ (line 96) | def __init__(self) -> None: method _parse (line 99) | def _parse(self, result) -> List[SearchResult]: method search (line 107) | def search(self, query) -> List[SearchResult]: function get_bing_search_raw_page (line 111) | def get_bing_search_raw_page(question: str): function query_bing (line 143) | def query_bing(question, max_tries=3,model=None,tokenizer=None): FILE: agent_auto_plan/autoplan/fuctions.py function gpt_35_api_stream (line 11) | def gpt_35_api_stream(messages: list): function bm25 (line 43) | def bm25(query, corpus,model=None): function get_check_text (line 65) | def get_check_text(sub_task_list): function get_tools_description (line 70) | def get_tools_description(tools): function get_task_and_question (line 80) | def get_task_and_question(path): function task_text_split (line 102) | def task_text_split(text,question_orgin):#将任务分解后的输出变成任务列表,这里是用了qwen第一次th... function distance (line 115) | def distance(query,map_dict):#计算距离 FILE: agent_auto_plan/autoplan/load_model.py function get_model (line 6) | def get_model(args): FILE: agent_auto_plan/autoplan/lora_inference_nomerge.py function get_merge_model (line 9) | def get_merge_model(base_path,adapter_path): function split_task (line 27) | def split_task(question,tokenizer,merge_model,prompt=None): function format_outputs (line 51) | def format_outputs(outputs):#将输出格式化 function test (line 61) | def test(): function stopping_criteria (line 94) | def stopping_criteria(cur_len,output_so_far): FILE: agent_auto_plan/autoplan/main.py function _get_args (line 72) | def _get_args(): function llm_with_plugin (line 126) | def llm_with_plugin( function build_input_text (line 315) | def build_input_text(chat_history, list_of_plugin_info) -> str: function text_completion (line 370) | def text_completion(input_text: str, stop_words) -> str: # 作为一个文本续写模型来使用 function parse_latest_plugin_call (line 394) | def parse_latest_plugin_call(text): function test (line 426) | def test(): FILE: agent_auto_plan/autoplan/prompt_plamte.py function check_action_inputs (line 97) | def check_action_inputs(question,action,list_of_plugin_info,history=None... function prompt_task_split (line 144) | def prompt_task_split(question,tools,args,write_file):#任务分解函数 FILE: agent_auto_plan/autoplan/tools_introduction.py function call_plugin (line 199) | def call_plugin(plugin_name: str, plugin_args: str,write_file,embeding_m... FILE: agent_auto_plan/finetune_language/dataset.py class SupervisedDataset (line 23) | class SupervisedDataset(Dataset): method __init__ (line 26) | def __init__( method __len__ (line 49) | def __len__(self): method __getitem__ (line 52) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: function data_collator (line 94) | def data_collator(examples, padding_value=0, max_length=2048): function conversation_to_ids (line 132) | def conversation_to_ids(conversation, tokenizer, llm_type=None, new_sche... function conversation_to_ids_minicpm (line 206) | def conversation_to_ids_minicpm(conversation, tokenizer): function conversation_to_ids_llama3 (line 238) | def conversation_to_ids_llama3(conversation, tokenizer): function conversation_to_ids_qwen2 (line 278) | def conversation_to_ids_qwen2(conversation, tokenizer): function preprocess (line 317) | def preprocess( function slice_image (line 418) | def slice_image( function ensure_divide (line 477) | def ensure_divide(length, patch_size): function find_best_resize (line 481) | def find_best_resize(original_size, scale_resolution, patch_size, allow_... function get_refine_size (line 492) | def get_refine_size( function split_to_patches (line 516) | def split_to_patches(image, grid): function get_grid_placeholder (line 533) | def get_grid_placeholder(tokenizer, grid, query_num, new_schema=False): function reshape_by_patch (line 559) | def reshape_by_patch(image_tensor, patch_size): FILE: agent_auto_plan/finetune_language/finetune.py class ModelArguments (line 27) | class ModelArguments: class DataArguments (line 32) | class DataArguments: class TrainingArguments (line 42) | class TrainingArguments(transformers.TrainingArguments): class LoraArguments (line 59) | class LoraArguments: function rank0_print (line 73) | def rank0_print(*args): function safe_save_model_for_hf_trainer (line 78) | def safe_save_model_for_hf_trainer(trainer, output_dir: str, bias="none"): function make_supervised_data_module (line 84) | def make_supervised_data_module( function build_transform (line 137) | def build_transform(): function get_parameter_number (line 149) | def get_parameter_number(model): function train (line 167) | def train(): FILE: agent_auto_plan/finetune_language/merge_lora.py function copy_files_not_in_B (line 11) | def copy_files_not_in_B(A_path, B_path): FILE: agent_auto_plan/finetune_language/replace_file/modeling_minicpmv.py class MiniCPMVPreTrainedModel (line 18) | class MiniCPMVPreTrainedModel(Qwen2PreTrainedModel): class MiniCPMV (line 22) | class MiniCPMV(MiniCPMVPreTrainedModel): method __init__ (line 23) | def __init__(self, config): method init_vision_module (line 37) | def init_vision_module(self): method init_resampler (line 53) | def init_resampler(self, embed_dim, vision_dim): method get_input_embeddings (line 62) | def get_input_embeddings(self): method set_input_embeddings (line 65) | def set_input_embeddings(self, value): method get_output_embeddings (line 68) | def get_output_embeddings(self): method set_output_embeddings (line 71) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 74) | def set_decoder(self, decoder): method prepare_inputs_for_generation (line 77) | def prepare_inputs_for_generation( method get_decoder (line 125) | def get_decoder(self): method get_vllm_embedding (line 128) | def get_vllm_embedding(self, data): method forward (line 236) | def forward(self, data, **kwargs): method _decode (line 257) | def _decode(self, inputs_embeds, tokenizer, attention_mask, decode_tex... method _decode_stream (line 270) | def _decode_stream(self, inputs_embeds, tokenizer, **kwargs): method _decode_text (line 286) | def _decode_text(self, result_ids, tokenizer): method generate (line 298) | def generate( method chat (line 342) | def chat( FILE: agent_auto_plan/qwen_vllm.py function save_to_jsonl (line 17) | def save_to_jsonl(data, output_file): function save_to_excel (line 21) | def save_to_excel(data, output_file): function process_prompt (line 30) | def process_prompt(prompt): FILE: agent_demo/agent_demo.py class SequenceStoppingCriteria (line 29) | class SequenceStoppingCriteria(StoppingCriteria): method __init__ (line 30) | def __init__(self, sequence_ids): method check_sequences (line 33) | def check_sequences(self, current_tokens, sequences): method __call__ (line 46) | def __call__(self, input_ids, scores, **kwargs): function llm_with_plugin (line 114) | def llm_with_plugin(prompt: str, history, list_of_plugin_info=()): function build_input_text (line 141) | def build_input_text(chat_history, list_of_plugin_info) -> str: function text_completion (line 186) | def text_completion(input_text: str, stop_words) -> str: # 作为一个文本续写模型来使用 function parse_latest_plugin_call (line 210) | def parse_latest_plugin_call(text): function call_plugin (line 235) | def call_plugin(plugin_name: str, plugin_args: str) -> str: function test (line 310) | def test(): FILE: agent_demo/build_react_prompt.py function build_input_text (line 24) | def build_input_text(chat_history, list_of_plugin_info) -> str: function parse_latest_plugin_call (line 71) | def parse_latest_plugin_call(text): FILE: agent_demo/get_react_data.py function save_cpm3_data (line 78) | def save_cpm3_data(cpm3_data_path,cpm3_data): function switch_cpm_tool (line 86) | def switch_cpm_tool(tools): function function_call (line 126) | def function_call(plugin_name, plugin_args): function split_react_data (line 152) | def split_react_data(react_str): function get_answer_from_output (line 170) | def get_answer_from_output(output): function get_tool_description (line 177) | def get_tool_description(tool): function get_question (line 191) | def get_question(): function get_react_data (line 220) | def get_react_data(): function get_cpm_function_call (line 259) | def get_cpm_function_call(): FILE: ft_language_replace_file/finetune/dataset.py class SupervisedDataset (line 23) | class SupervisedDataset(Dataset): method __init__ (line 26) | def __init__( method __len__ (line 47) | def __len__(self): method __getitem__ (line 50) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: function data_collator (line 87) | def data_collator(examples, padding_value=0, max_length=2048): function conversation_to_ids (line 125) | def conversation_to_ids(conversation, tokenizer, llm_type=None): function conversation_to_ids_minicpm (line 178) | def conversation_to_ids_minicpm(conversation, tokenizer): function conversation_to_ids_llama3 (line 210) | def conversation_to_ids_llama3(conversation, tokenizer): function preprocess (line 252) | def preprocess( function slice_image (line 352) | def slice_image( function ensure_divide (line 411) | def ensure_divide(length, patch_size): function find_best_resize (line 415) | def find_best_resize(original_size, scale_resolution, patch_size, allow_... function get_refine_size (line 426) | def get_refine_size( function split_to_patches (line 450) | def split_to_patches(image, grid): function get_grid_placeholder (line 467) | def get_grid_placeholder(tokenizer, grid, query_num): function reshape_by_patch (line 485) | def reshape_by_patch(image_tensor, patch_size): FILE: ft_language_replace_file/finetune/finetune.py class ModelArguments (line 44) | class ModelArguments: class DataArguments (line 49) | class DataArguments: class TrainingArguments (line 59) | class TrainingArguments(transformers.TrainingArguments): class LoraArguments (line 76) | class LoraArguments: function maybe_zero_3 (line 89) | def maybe_zero_3(param): function get_peft_state_maybe_zero_3 (line 100) | def get_peft_state_maybe_zero_3(named_params, bias): function rank0_print (line 126) | def rank0_print(*args): function safe_save_model_for_hf_trainer (line 131) | def safe_save_model_for_hf_trainer(trainer, output_dir: str, bias="none"): function make_supervised_data_module (line 147) | def make_supervised_data_module( function get_parameter_number (line 197) | def get_parameter_number(model): function train (line 215) | def train(): FILE: ft_language_replace_file/finetune/only_language_web_demo.py function create_component (line 110) | def create_component(params, comp='Slider'): function chat (line 134) | def chat(img, msgs, ctx, params=None, vision_hidden_states=None): function upload_img (line 175) | def upload_img(image, _chatbot, _app_session): function respond (line 185) | def respond(_question, _chat_bot, _app_cfg, params_form, num_beams, repe... function regenerate_button_clicked (line 227) | def regenerate_button_clicked(_question, _chat_bot, _app_cfg, params_for... FILE: ft_language_replace_file/finetune/replace_file/modeling_minicpmv.py class MiniCPMVPreTrainedModel (line 25) | class MiniCPMVPreTrainedModel(LlamaPreTrainedModel): class MiniCPMV (line 29) | class MiniCPMV(MiniCPMVPreTrainedModel): method __init__ (line 30) | def __init__(self, config): method init_vision_module (line 40) | def init_vision_module(self): method init_resampler (line 51) | def init_resampler(self, embed_dim, vision_dim,): method init_transform (line 60) | def init_transform(self): method get_input_embeddings (line 70) | def get_input_embeddings(self): method set_input_embeddings (line 73) | def set_input_embeddings(self, value): method get_vllm_embedding (line 76) | def get_vllm_embedding(self, data): method forward (line 184) | def forward(self, data, **kwargs): method _convert_to_tensors (line 206) | def _convert_to_tensors( method _process_list (line 231) | def _process_list( method _decode (line 246) | def _decode(self, inputs_embeds, tokenizer, **kwargs): method _decode_stream (line 259) | def _decode_stream(self, inputs_embeds, tokenizer, **kwargs): method _decode_text (line 278) | def _decode_text(self, result_ids, tokenizer): method slice_image (line 289) | def slice_image(self, image): method get_slice_image_placeholder (line 297) | def get_slice_image_placeholder(self, image, tokenizer): method reshape_by_patch (line 327) | def reshape_by_patch(self, image_tensor): method generate (line 344) | def generate( method chat (line 396) | def chat( class PreTrainedTokenizerFastWrapper (line 509) | class PreTrainedTokenizerFastWrapper(PreTrainedTokenizerFast): method __init__ (line 510) | def __init__(self, **kwargs): method eos_id (line 525) | def eos_id(self): method bos_id (line 529) | def bos_id(self): method unk_id (line 533) | def unk_id(self): method eot_id (line 537) | def eot_id(self): method im_start_id (line 541) | def im_start_id(self): method im_end_id (line 545) | def im_end_id(self): method escape (line 549) | def escape(text: str) -> str: method unescape (line 553) | def unescape(text: str) -> str: function pad (line 557) | def pad(orig_items, key, max_length=None, padding_value=0, padding_side=... function slice_image (line 605) | def slice_image( function ensure_divide (line 662) | def ensure_divide(length, patch_size): function find_best_resize (line 666) | def find_best_resize(original_size, scale_resolution, patch_size, allow_... function get_refine_size (line 677) | def get_refine_size( function split_to_patches (line 701) | def split_to_patches(image, grid): function get_grid_placeholder (line 718) | def get_grid_placeholder(tokenizer, grid, query_num): FILE: ft_language_replace_file/finetune/replace_file/resampler.py function get_2d_sincos_pos_embed (line 17) | def get_2d_sincos_pos_embed(embed_dim, image_size): function get_2d_sincos_pos_embed_from_grid (line 37) | def get_2d_sincos_pos_embed_from_grid(embed_dim, grid): function get_1d_sincos_pos_embed_from_grid_new (line 48) | def get_1d_sincos_pos_embed_from_grid_new(embed_dim, pos): class Resampler (line 68) | class Resampler(nn.Module): method __init__ (line 76) | def __init__( method _set_2d_pos_cache (line 109) | def _set_2d_pos_cache(self, max_size, device='cpu'): method _adjust_pos_cache (line 115) | def _adjust_pos_cache(self, tgt_sizes, device): method _init_weights (line 122) | def _init_weights(self, m): method forward (line 131) | def forward(self, x, tgt_sizes=None): method _repeat (line 172) | def _repeat(self, query, N: int): class MultiheadAttention (line 176) | class MultiheadAttention(nn.MultiheadAttention): method __init__ (line 177) | def __init__(self, embed_dim, num_heads, dropout=0., bias=True, add_bi... method forward (line 184) | def forward( method multi_head_attention_forward (line 340) | def multi_head_attention_forward( function _mha_shape_check (line 624) | def _mha_shape_check(query: Tensor, key: Tensor, value: Tensor, function _canonical_mask (line 672) | def _canonical_mask( function _none_or_dtype (line 701) | def _none_or_dtype(input: Optional[Tensor]) -> Optional[DType]: function _in_projection_packed (line 708) | def _in_projection_packed( function _in_projection (line 768) | def _in_projection( FILE: ft_language_replace_file/finetune/trainer.py class CPMTrainer (line 11) | class CPMTrainer(Trainer): method compute_loss (line 12) | def compute_loss(self, model, inputs, return_outputs=False): method prediction_step (line 44) | def prediction_step( method training_step (line 172) | def training_step(self, model: nn.Module, inputs: Dict[str, Union[torc... method _save (line 214) | def _save(self, output_dir: Optional[str] = None, state_dict=None): FILE: get_minicpmv2.6_embeding/dataset.py class ImageDataset (line 19) | class ImageDataset(Dataset): method __init__ (line 21) | def __init__( method __len__ (line 42) | def __len__(self): method __getitem__ (line 45) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: class QueryDataset (line 72) | class QueryDataset(Dataset): method __init__ (line 75) | def __init__( method __len__ (line 86) | def __len__(self): method __getitem__ (line 89) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: function data_collator_query (line 116) | def data_collator_query(examples, padding_value=0, max_length=2048): function data_collator (line 126) | def data_collator(examples, padding_value=0, max_length=2048,device='cpu'): function load_from_pdf (line 162) | def load_from_pdf(pdf_path: str): function load_from_json (line 167) | def load_from_json(json_path: str): function conversation_to_ids (line 173) | def conversation_to_ids(conversation, tokenizer, llm_type=None, new_sche... function conversation_to_ids_minicpm (line 238) | def conversation_to_ids_minicpm(conversation, tokenizer): function conversation_to_ids_llama3 (line 270) | def conversation_to_ids_llama3(conversation, tokenizer): function conversation_to_ids_qwen2 (line 310) | def conversation_to_ids_qwen2(conversation, tokenizer): function preprocess (line 350) | def preprocess( function slice_image (line 446) | def slice_image( function ensure_divide (line 505) | def ensure_divide(length, patch_size): function find_best_resize (line 509) | def find_best_resize(original_size, scale_resolution, patch_size, allow_... function get_refine_size (line 520) | def get_refine_size( function split_to_patches (line 544) | def split_to_patches(image, grid): function get_grid_placeholder (line 561) | def get_grid_placeholder(tokenizer, grid, query_num, new_schema=False): function reshape_by_patch (line 582) | def reshape_by_patch(image_tensor, patch_size): FILE: get_minicpmv2.6_embeding/inference.py function build_transform (line 9) | def build_transform(): function main (line 20) | def main() -> None: FILE: get_minicpmv2.6_embeding/modeling_minicpmv.py class MiniCPMVPreTrainedModel (line 18) | class MiniCPMVPreTrainedModel(Qwen2PreTrainedModel): class MiniCPMV (line 22) | class MiniCPMV(MiniCPMVPreTrainedModel): method __init__ (line 23) | def __init__(self, config): method init_vision_module (line 34) | def init_vision_module(self): method init_resampler (line 50) | def init_resampler(self, embed_dim, vision_dim): method get_input_embeddings (line 59) | def get_input_embeddings(self): method set_input_embeddings (line 62) | def set_input_embeddings(self, value): method get_output_embeddings (line 65) | def get_output_embeddings(self): method set_output_embeddings (line 68) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 71) | def set_decoder(self, decoder): method get_decoder (line 74) | def get_decoder(self): method get_vllm_embedding (line 77) | def get_vllm_embedding(self, data): method forward (line 174) | def forward(self, data, **kwargs): method _decode (line 193) | def _decode(self, inputs_embeds, tokenizer, attention_mask, decode_tex... method _decode_stream (line 206) | def _decode_stream(self, inputs_embeds, tokenizer, **kwargs): method _decode_text (line 222) | def _decode_text(self, result_ids, tokenizer): method generate (line 234) | def generate( method chat (line 278) | def chat( FILE: mbti_role_play/mbti_demo.py function check_model_v (line 44) | def check_model_v(img_file_path: str = None): function hf_gen (line 68) | def hf_gen(dialog: List, top_p: float, temperature: float, repetition_pe... function hf_v_gen (line 102) | def hf_v_gen(dialog: List, top_p: float, temperature: float, repetition_... function generate (line 134) | def generate(chat_history: List, query: str, I_E_choice: str, N_S_choice... function regenerate (line 174) | def regenerate(chat_history: List, I_E_choice, N_S_choice, T_F_choice, J... function clear_history (line 212) | def clear_history(): function reverse_last_round (line 221) | def reverse_last_round(chat_history): function process_choice (line 232) | def process_choice(I_E, N_S, T_F, J_P): FILE: mbti_role_play/mbti_sft_dpo_data/get_rank_data.py function load_json (line 8) | def load_json(file_path): FILE: windows_minicpm3.0_agent/app.py function search (line 17) | def search(query: str, ds, images): function index (line 39) | def index(file, ds): FILE: windows_minicpm3.0_agent/cli_demo.py function get_relevant_image (line 13) | def get_relevant_image(query,file_path): FILE: windows_minicpm3.0_agent/dataset.py class ImageDataset (line 19) | class ImageDataset(Dataset): method __init__ (line 21) | def __init__( method __len__ (line 42) | def __len__(self): method __getitem__ (line 45) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: class QueryDataset (line 72) | class QueryDataset(Dataset): method __init__ (line 75) | def __init__( method __len__ (line 86) | def __len__(self): method __getitem__ (line 89) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: function data_collator_query (line 103) | def data_collator_query(examples, padding_value=0, max_length=2048): function data_collator (line 113) | def data_collator(examples, padding_value=0, max_length=2048,device='cpu'): function load_from_pdf (line 150) | def load_from_pdf(pdf_path: str): function load_from_json (line 155) | def load_from_json(json_path: str): function conversation_to_ids (line 161) | def conversation_to_ids(conversation, tokenizer, llm_type=None, new_sche... function conversation_to_ids_minicpm (line 226) | def conversation_to_ids_minicpm(conversation, tokenizer): function conversation_to_ids_llama3 (line 258) | def conversation_to_ids_llama3(conversation, tokenizer): function conversation_to_ids_qwen2 (line 298) | def conversation_to_ids_qwen2(conversation, tokenizer): function preprocess (line 338) | def preprocess( function slice_image (line 434) | def slice_image( function ensure_divide (line 493) | def ensure_divide(length, patch_size): function find_best_resize (line 497) | def find_best_resize(original_size, scale_resolution, patch_size, allow_... function get_refine_size (line 508) | def get_refine_size( function split_to_patches (line 532) | def split_to_patches(image, grid): function get_grid_placeholder (line 549) | def get_grid_placeholder(tokenizer, grid, query_num, new_schema=False): function reshape_by_patch (line 570) | def reshape_by_patch(image_tensor, patch_size): FILE: windows_minicpm3.0_agent/inference.py function main (line 12) | def main() -> None: FILE: windows_minicpm3.0_agent/utils.py function evaluate_colbert (line 4) | def evaluate_colbert( qs, ps, batch_size=128) -> torch.Tensor: function build_transform (line 22) | def build_transform(): FILE: windows_minicpm3.0_agent/windows_agent.py function text_to_image_search (line 20) | def text_to_image_search(text_description,images_path): function image_anwer_question (line 23) | def image_anwer_question(image_path,query): function fake_tool_execute (line 40) | def fake_tool_execute(toolcalls): function clear_cuda_variables (line 114) | def clear_cuda_variables():