MCPcopy Create free account

hub / github.com/baaivision/Emu3 / functions

Functions136 in github.com/baaivision/Emu3

↓ 13 callersMethod__init__
(self, config)
emu3/tokenizer/modeling_emu3visionvq.py:751
↓ 12 callersMethoddecode
(self, *args, **kwargs)
emu3/mllm/processing_emu3.py:197
↓ 11 callersMethodencode
(self, x: torch.Tensor)
emu3/tokenizer/modeling_emu3visionvq.py:766
↓ 9 callersMethod__init__
(self, config)
emu3/mllm/modeling_emu3.py:243
↓ 4 callersFunctionrepeat_kv
This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch, num_key_value_heads, seqlen, he
emu3/mllm/modeling_emu3.py:276
↓ 3 callersFunctionapply_rotary_pos_emb
Applies Rotary Position Embedding to the query and key tensors. Args: q (`torch.Tensor`): The query tensor. k (`torch.Tensor`): T
emu3/mllm/modeling_emu3.py:214
↓ 3 callersMethodbatch_decode
(self, *args, **kwargs)
emu3/mllm/processing_emu3.py:192
↓ 3 callersMethodbuild_prefix_constrained_fn
(self, height, width)
emu3/mllm/processing_emu3.py:333
↓ 3 callersMethodpostprocess
Postprocess an image or batch of images tensor. Postprocess is the reverse process of preprocess. The parameters should be same as in
emu3/tokenizer/image_processing_emu3visionvq.py:351
↓ 2 callersMethod_set_cos_sin_cache
(self, seq_len, device, dtype)
emu3/mllm/modeling_emu3.py:141
↓ 2 callersFunctionimage2str
(image)
gradio_demo.py:24
↓ 2 callersMethodmultimodal_decode
(self, doc)
emu3/mllm/processing_emu3.py:210
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
emu3/mllm/modeling_emu3.py:207
↓ 2 callersMethodto_tuple
(self, value, dim=3)
emu3/tokenizer/image_processing_emu3visionvq.py:438
↓ 1 callersMethod_flash_attention_forward
Calls the forward method of Flash Attention - if the input hidden states contain at least one padding token first unpad the input, th
emu3/mllm/modeling_emu3.py:562
↓ 1 callersFunction_get_unpad_data
(attention_mask)
emu3/mllm/modeling_emu3.py:76
↓ 1 callersMethod_init_rope
(self)
emu3/mllm/modeling_emu3.py:324
↓ 1 callersFunction_load_tiktoken_bpe
(tiktoken_bpe_file: str)
emu3/mllm/tokenization_emu3.py:46
↓ 1 callersMethod_preprocess
Preprocess an image or batch of images. Copy of the `preprocess` method from `CLIPImageProcessor`. Args: images (`ImageI
emu3/tokenizer/image_processing_emu3visionvq.py:146
↓ 1 callersMethod_rope_scaling_validation
Validate the `rope_scaling` configuration.
emu3/mllm/configuration_emu3.py:194
↓ 1 callersMethod_upad_input
(self, query_layer, key_layer, value_layer, attention_mask, query_length)
emu3/mllm/modeling_emu3.py:621
↓ 1 callersMethodbuild_const_helper
(self)
emu3/mllm/processing_emu3.py:300
↓ 1 callersMethodcalculate_generate_size
(self, ratio, image_area, spatial_scale_factor)
emu3/mllm/processing_emu3.py:254
↓ 1 callersFunctiondownload_weights
(url, dest)
replicate_demo/predict_gen.py:42
↓ 1 callersFunctiondownload_weights
(url, dest)
replicate_demo/predict_chat.py:37
↓ 1 callersMethodformat_image_prompt
(self, image_tokens)
emu3/train/datasets.py:61
↓ 1 callersMethodforward
(self, x)
emu3/mllm/modeling_emu3.py:253
↓ 1 callersFunctiongenerate_image
(prompt)
gradio_demo.py:70
↓ 1 callersMethodinverse_meanstd
(self, image_mean, image_std)
emu3/tokenizer/image_processing_emu3visionvq.py:429
↓ 1 callersFunctionmain
()
emu3/train/prepare_data.py:36
↓ 1 callersFunctionprepare_args
()
emu3/train/prepare_data.py:13
↓ 1 callersFunctionsmart_resize
Rescales the image so that the following conditions are met: 1. Both dimensions (height and width) are divisible by 'factor'. 2. The total n
emu3/tokenizer/image_processing_emu3visionvq.py:53
↓ 1 callersFunctionsmart_resize
(image, image_area: int = 720 * 720)
emu3/train/prepare_data.py:24
↓ 1 callersMethodto_imgstr
(self, image_tokens)
emu3/mllm/processing_emu3.py:241
↓ 1 callersMethodto_imgstr
(self, image_tokens)
emu3/train/datasets.py:77
↓ 1 callersMethodtokenize_image
(self, image: List[Image.Image], *, padding_image: bool = False)
emu3/mllm/processing_emu3.py:263
↓ 1 callersFunctiontrain
()
emu3/train/train.py:53
↓ 1 callersFunctionupdate_configs
(model_config, args, fields)
emu3/train/train.py:42
↓ 1 callersFunctionvision_language_understanding
(image, text)
gradio_demo.py:138
Method__call__
Main method to prepare for the model one or several sequences(s) and image(s). This method forwards the `text` and `kwargs` arguments
emu3/mllm/processing_emu3.py:84
Method__call__
(self, batch_id, input_ids)
emu3/mllm/utils_emu3.py:45
Method__call__
(self, x: torch.Tensor)
emu3/tokenizer/modeling_emu3visionvq.py:33
Method__getitem__
(self, index: int)
emu3/train/datasets.py:30
Method__getstate__
(self)
emu3/mllm/tokenization_emu3.py:129
Method__init__
( self, vocab_size: int = 184622, hidden_size: int = 4096, intermediate_size:
emu3/mllm/configuration_emu3.py:128
Method__init__
Emu3RMSNorm is equivalent to T5LayerNorm
emu3/mllm/modeling_emu3.py:107
Method__init__
(self, dim, max_position_embeddings=2048, base=10000, device=None)
emu3/mllm/modeling_emu3.py:127
Method__init__
(self, dim, max_position_embeddings=2048, base=10000, device=None, scaling_factor=1.0)
emu3/mllm/modeling_emu3.py:165
Method__init__
(self, dim, max_position_embeddings=2048, base=10000, device=None, scaling_factor=1.0)
emu3/mllm/modeling_emu3.py:184
Method__init__
(self, config: Emu3Config, layer_idx: Optional[int] = None)
emu3/mllm/modeling_emu3.py:291
Method__init__
(self, *args, **kwargs)
emu3/mllm/modeling_emu3.py:466
Method__init__
(self, config: Emu3Config, layer_idx: int)
emu3/mllm/modeling_emu3.py:755
Method__init__
(self, config: Emu3Config)
emu3/mllm/modeling_emu3.py:952
Method__init__
(self, config)
emu3/mllm/modeling_emu3.py:1111
Method__init__
( self, vocab_file, special_tokens_file, errors="replace", bos_token =
emu3/mllm/tokenization_emu3.py:60
Method__init__
( self, image_processor=None, vision_tokenizer=None, tokenizer=None, c
emu3/mllm/processing_emu3.py:63
Method__init__
( self, height, width, img_token, eoi_token, eos_token,
emu3/mllm/utils_emu3.py:21
Method__init__
( self, do_resize: bool = True, resample: PILImageResampling = PILImageResampling.BICU
emu3/tokenizer/image_processing_emu3visionvq.py:117
Method__init__
( self, codebook_size: int = 32768, embed_dim: int = 4, z_channels: int = 4,
emu3/tokenizer/configuration_emu3visionvq.py:77
Method__init__
(self)
emu3/tokenizer/modeling_emu3visionvq.py:30
Method__init__
(self, in_channels: int)
emu3/tokenizer/modeling_emu3visionvq.py:39
Method__init__
(self, in_channels: int)
emu3/tokenizer/modeling_emu3visionvq.py:57
Method__init__
( self, in_channel: int, out_channel: int, kernel_size: Union[int, Tuple[int,
emu3/tokenizer/modeling_emu3visionvq.py:76
Method__init__
( self, in_channels: int, out_channels: Optional[int] = None, conv_shortcut:
emu3/tokenizer/modeling_emu3visionvq.py:111
Method__init__
( self, f_channels: int, zq_channels: int, norm_layer: nn.Module = nn.GroupNor
emu3/tokenizer/modeling_emu3visionvq.py:182
Method__init__
( self, in_channels: int, out_channels: Optional[int] = None, conv_shortcut: b
emu3/tokenizer/modeling_emu3visionvq.py:238
Method__init__
( self, in_channels: int, zq_ch: Optional[int] = None, add_conv: bool = False
emu3/tokenizer/modeling_emu3visionvq.py:322
Method__init__
( self, in_channel: int, out_channel: int, kernel_size: Tuple[int, ...] = (3,
emu3/tokenizer/modeling_emu3visionvq.py:395
Method__init__
( self, in_channel: int, out_channel: int, kernel_size: Tuple[int, ...] = (4,
emu3/tokenizer/modeling_emu3visionvq.py:423
Method__init__
(self, config: Emu3VisionVQConfig)
emu3/tokenizer/modeling_emu3visionvq.py:449
Method__init__
(self, config: Emu3VisionVQConfig)
emu3/tokenizer/modeling_emu3visionvq.py:473
Method__init__
(self, config: Emu3VisionVQConfig)
emu3/tokenizer/modeling_emu3visionvq.py:598
Method__init__
(self, args: "DataArguments", tokenizer: "Emu3Tokenizer")
emu3/train/datasets.py:13
Method__len__
(self)
emu3/mllm/tokenization_emu3.py:146
Method__len__
(self)
emu3/train/datasets.py:27
Method__setstate__
(self, state)
emu3/mllm/tokenization_emu3.py:135
Method_add_tokens
( self, new_tokens: Union[List[str], List[AddedToken]], special_tokens: bool = False,
emu3/mllm/tokenization_emu3.py:169
Method_convert_id_to_token
Converts an id to a token, special tokens included
emu3/mllm/tokenization_emu3.py:267
Method_convert_token_to_id
Converts a token to an id using the vocab, special tokens included
emu3/mllm/tokenization_emu3.py:273
Method_decode
( self, token_ids: Union[int, List[int]], skip_special_tokens: bool = False, e
emu3/mllm/tokenization_emu3.py:281
Function_expand_mask
(mask: torch.Tensor, dtype: torch.dtype, tgt_len: Optional[int] = None)
emu3/mllm/modeling_emu3.py:88
Method_init_weights
(self, module)
emu3/mllm/modeling_emu3.py:858
Method_init_weights
(self, module)
emu3/tokenizer/modeling_emu3visionvq.py:734
Function_make_causal_mask
( input_ids_shape: torch.Size, dtype: torch.dtype, device: torch.device, past_key_values_length: int = 0 )
emu3/mllm/modeling_emu3.py:95
Method_reorder_cache
(past_key_values, beam_idx)
emu3/mllm/modeling_emu3.py:1337
Method_set_cos_sin_cache
(self, seq_len, device, dtype)
emu3/mllm/modeling_emu3.py:169
Method_set_cos_sin_cache
(self, seq_len, device, dtype)
emu3/mllm/modeling_emu3.py:188
Method_shape
(self, tensor: torch.Tensor, seq_len: int, bsz: int)
emu3/mllm/modeling_emu3.py:351
Functionchat
(history, user_input, user_image)
gradio_demo.py:174
Functionclear_input
()
gradio_demo.py:195
Methodconvert_tokens_to_ids
( self, tokens: Union[bytes, str, List[Union[bytes, str]]] )
emu3/mllm/tokenization_emu3.py:152
Methodconvert_tokens_to_string
Converts a sequence of tokens in a single string.
emu3/mllm/tokenization_emu3.py:243
Methoddecode
(self, x: torch.Tensor)
emu3/tokenizer/modeling_emu3visionvq.py:790
Methoddevice
(self)
emu3/tokenizer/modeling_emu3visionvq.py:817
Methoddtype
(self)
emu3/tokenizer/modeling_emu3visionvq.py:821
Methodforward
(self, hidden_states)
emu3/mllm/modeling_emu3.py:115
Methodforward
(self, x, seq_len=None)
emu3/mllm/modeling_emu3.py:151
Methodforward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.Tensor] = None,
emu3/mllm/modeling_emu3.py:354
Methodforward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.LongTensor] = None
emu3/mllm/modeling_emu3.py:474
Methodforward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.Tensor] = None,
emu3/mllm/modeling_emu3.py:668
next →1–100 of 136, ranked by callers