Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ByteDance-Seed/Bagel
/ functions
Functions
720 in github.com/ByteDance-Seed/Bagel
⨍
Functions
720
◇
Types & classes
116
↳
Endpoints
2
Method
forward
Args: sequence_length: length of sequence. packed_text_ids: 1-D int tensor, packed text token ids. packed
modeling/bagel/bagel.py:101
Method
forward
(self, pixel_values: torch.FloatTensor, interpolate_pos_encoding=False)
modeling/siglip/modeling_siglip.py:298
Method
forward
( self, input_ids: Optional[torch.LongTensor] = None, position_ids: Optional[torch.Lon
modeling/siglip/modeling_siglip.py:324
Method
forward
Input shape: Batch x Time x Channel
modeling/siglip/modeling_siglip.py:367
Method
forward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.LongTensor] = None
modeling/siglip/modeling_siglip.py:439
Method
forward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.Tensor] = None,
modeling/siglip/modeling_siglip.py:524
Method
forward
Args: hidden_states (`torch.FloatTensor`): Input to the layer of shape `(batch, seq_len, embed_dim)`.
modeling/siglip/modeling_siglip.py:613
Method
forward
r""" Args: inputs_embeds (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`): Optionally,
modeling/siglip/modeling_siglip.py:840
Method
forward
r""" Returns:
modeling/siglip/modeling_siglip.py:926
Method
forward
r""" Returns: Examples: ```python >>> from transformers import AutoTokenizer, SiglipTextModel >>> model = S
modeling/siglip/modeling_siglip.py:1006
Method
forward
r""" Returns:
modeling/siglip/modeling_siglip.py:1060
Method
forward
(self, hidden_state)
modeling/siglip/modeling_siglip.py:1113
Method
forward
r""" Returns: Examples: ```python >>> from PIL import Image >>> import requests >>> from transformer
modeling/siglip/modeling_siglip.py:1147
Method
forward
r""" Returns: Examples: ```python >>> from PIL import Image >>> import requests >>> from transformer
modeling/siglip/modeling_siglip.py:1327
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for computing the image classification/regression lo
modeling/siglip/modeling_siglip.py:1460
Method
forward
Args: img (PIL Image): Image to be resized. img_num (int): Number of images, used to change max_tokens. Retur
data/transforms.py:60
Method
from_pretrained
(cls, pretrained_model_name_or_path: Union[str, os.PathLike], **kwargs)
modeling/siglip/configuration_siglip.py:199
Method
from_text_vision_configs
r""" Instantiate a [`SiglipConfig`] (or a derived class) from siglip text model configuration and siglip vision model configuration.
modeling/siglip/configuration_siglip.py:278
Function
full_and_noise_mask
(b, h, q_idx, kv_idx)
data/data_utils.py:17
Method
get_data_paths
(self, *args, **kwargs)
data/distributed_iterable_dataset.py:17
Method
get_decoder
(self)
modeling/qwen2/modeling_qwen2.py:839
Method
get_decoder
(self)
modeling/bagel/qwen2_navit.py:1128
Function
get_file_path
Search for a file across a directory and return its absolute path. Args: filename (Union[str, os.PathLike]): The name of the file to
eval/gen/gedit/viescore/utils.py:70
Function
get_flattened_position_ids_extrapolate
(img_h, img_w, patch_size, max_num_patches_per_side)
data/data_utils.py:53
Function
get_flattened_position_ids_interpolate
(img_h, img_w, patch_size, max_num_patches_per_side)
data/data_utils.py:61
Method
get_image_features
r""" Returns: image_features (`torch.FloatTensor` of shape `(batch_size, output_dim`): The image embeddings obtained by
modeling/siglip/modeling_siglip.py:1274
Function
get_image_size
(img_path)
eval/vlm/eval/mathvista/utilities.py:171
Method
get_input_embeddings
(self)
modeling/qwen2/modeling_qwen2.py:679
Method
get_input_embeddings
(self)
modeling/qwen2/modeling_qwen2.py:824
Method
get_input_embeddings
(self)
modeling/bagel/siglip_navit.py:386
Method
get_input_embeddings
(self)
modeling/bagel/qwen2_navit.py:1113
Method
get_input_embeddings
(self)
modeling/siglip/modeling_siglip.py:998
Method
get_input_embeddings
(self)
modeling/siglip/modeling_siglip.py:1142
Function
get_multi_choice_info
Given the list of options for multiple choice question Return the index2ans and all_choices
eval/vlm/eval/mmmu/data_utils.py:71
Method
get_output_embeddings
(self)
modeling/qwen2/modeling_qwen2.py:830
Method
get_output_embeddings
(self)
modeling/bagel/qwen2_navit.py:1119
Method
get_special_tokens_mask
Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding special tokens using the
modeling/siglip/tokenization_siglip.py:151
Method
get_text_features
r""" Returns: text_features (`torch.FloatTensor` of shape `(batch_size, output_dim`): The text embeddings obtained by
modeling/siglip/modeling_siglip.py:1225
Method
get_vocab
(self)
modeling/qwen2/tokenization_qwen2.py:204
Method
get_vocab
(self)
modeling/siglip/tokenization_siglip.py:145
Function
grad_checkpoint_check_fn
(module)
train/fsdp_utils.py:236
Function
inpainting
图像分割后随机空白部分patch,用于inpainting任务 参数: image: PIL.Image 输入图像(RGB模式) h_splits: int 行分割数(垂直方向分割块数) w_splits: int 列分割数
data/transforms.py:220
Function
is_bool_word
(text)
eval/vlm/eval/mathvista/utilities.py:126
Function
is_digit_string
(text)
eval/vlm/eval/mathvista/utilities.py:134
Function
is_float_string
(text)
eval/vlm/eval/mathvista/utilities.py:145
Function
is_str_a_list_of_ints_0_to_10
(s)
eval/gen/gedit/viescore/utils.py:108
Function
is_str_valid_score_format_brackets
(s)
eval/gen/gedit/viescore/utils.py:124
Function
load_csv
(f)
eval/gen/rise/utils.py:75
Function
load_json
(pth)
eval/gen/rise/utils.py:61
Function
load_jsonl
(f)
eval/gen/rise/utils.py:64
Function
load_pkl
(pth)
eval/gen/rise/utils.py:58
Function
load_tsv
(f)
eval/gen/rise/utils.py:78
Function
load_xlsx
(f)
eval/gen/rise/utils.py:72
Function
load_yaml
(file_path)
eval/vlm/eval/mmmu/data_utils.py:87
Function
merge_images
Merge multiple images into one image Args: image_links (List, optional): List of image links. Defaults to []. Returns:
eval/gen/gedit/viescore/mllm_tools/utils.py:30
Method
model_input_names
(self)
modeling/siglip/processing_siglip.py:128
Function
motion_blur_opencv
(image, kernel_size=15, angle=0)
data/transforms.py:144
Method
num_layers
(self)
modeling/bagel/qwen2_navit.py:213
Function
parse_multi_choice_response
Parse the prediction from the generated response. Return the predicted index e.g., A, B, C, D.
eval/vlm/eval/mmmu/eval_utils.py:22
Method
parse_row
(self, row)
data/interleave_datasets/edit_dataset.py:21
Function
pil_image_to_base64
(pil_image, format="PNG")
eval/gen/gedit/viescore/mllm_tools/utils.py:7
Method
pin_memory
(self)
data/dataset_base.py:517
Function
post_process
(response)
eval/vlm/eval/vqa/evaluate_vqa.py:300
Method
prepare_for_tokenization
(self, text, **kwargs)
modeling/qwen2/tokenization_qwen2.py:326
Function
prepare_img
()
modeling/siglip/convert_siglip_to_hf.py:225
Method
preprocess
Preprocess an image or batch of images. Args: images (`ImageInput`): Image to preprocess. Expects a sing
modeling/siglip/image_processing_siglip.py:100
Function
process_edit_image
(image, prompt, show_thinking, cfg_text_scale, cfg_img_scale, cfg_interval,
app.py:431
Function
process_image_eval
Thread worker: evaluate a single image and save results
eval/gen/kris/metrics_knowledge.py:403
Function
process_image_eval
Thread worker: evaluate a single image and save results
eval/gen/kris/metrics_common.py:326
Function
process_image_eval
Helper for threaded evaluation of a single image.
eval/gen/kris/metrics_view_change.py:283
Function
process_multi_element_image_eval
Thread worker: evaluate one image, save results and return packaged data.
eval/gen/kris/metrics_multi_element.py:315
Function
process_problem
(pid, results, label, args)
eval/vlm/eval/mathvista/extract_answer_mp.py:87
Function
process_prompt
(prompt_id, prompt_data, config)
eval/gen/wise/gpt_eval_mp.py:197
Function
process_single_item
(key, item, result_img_folder, origin_img_root, prompts, output_jsonl_path)
eval/gen/imgedit/basic_bench.py:90
Function
process_single_item
(item, vie_score, max_retries=10000)
eval/gen/gedit/test_gedit_score.py:24
Function
process_temporal_image_eval
Thread worker: evaluate and package results for one image.
eval/gen/kris/metrics_temporal_prediction.py:361
Function
process_text_to_image
(prompt, show_thinking, cfg_text_scale, cfg_interval, timestep_shift,
app.py:339
Function
process_understanding
(image, prompt, show_thinking, do_sample, text_temperature, max_new_tokens)
app.py:485
Function
read_csv
(file)
eval/vlm/eval/mathvista/utilities.py:30
Function
read_file_to_string
Reads the contents of a text file and returns it as a string. :param file_path: The path to the text file. :return: A string containing
eval/gen/gedit/viescore/utils.py:31
Function
read_files_to_string
Reads the contents of multiple text files and returns them as a single string, with each file's contents separated by a newline. :param
eval/gen/gedit/viescore/utils.py:48
Function
read_frames_decord
(video_path, num_frames, sample='rand', fix_start=None, clip=None, min_num_frames=4)
data/video_utils.py:63
Function
read_frames_folder
(video_path, num_frames, sample='rand', fix_start=None, min_num_frames=4)
data/video_utils.py:98
Function
read_jsonl
(file)
eval/vlm/eval/mathvista/utilities.py:50
Function
read_pandas_csv
(csv_path)
eval/vlm/eval/mathvista/utilities.py:38
Function
read_pickle
(path)
eval/vlm/eval/mathvista/utilities.py:56
Function
remove_noise_mask
(b, h, q_idx, kv_idx)
data/data_utils.py:20
Function
sample_mask
(b, h, q_idx, kv_idx)
data/data_utils.py:23
Function
sample_mp4_frames
(mp4_p, n_frames=None, fps=None, return_frame_indices=False, random_sample=False)
data/video_utils.py:135
Function
sample_mp4_frames_by_indices
(mp4_p, frame_indices: list)
data/video_utils.py:157
Function
save_args
(args, path_dir)
eval/vlm/eval/mmmu/data_utils.py:139
Function
save_array_img
(path, image)
eval/vlm/eval/mathvista/utilities.py:66
Function
save_json
(filename, ds)
eval/vlm/eval/mmmu/data_utils.py:66
Function
save_jsonl
Save a dictionary of data to a JSON Lines file with the filename as key and caption as value. Args: filename (str): The path to the
eval/vlm/eval/mmmu/data_utils.py:121
Method
save_vocabulary
(self, save_directory: str, filename_prefix: Optional[str] = None)
modeling/qwen2/tokenization_qwen2_fast.py:121
Method
save_vocabulary
(self, save_directory: str, filename_prefix: Optional[str] = None)
modeling/qwen2/tokenization_qwen2.py:297
Method
save_vocabulary
(self, save_directory: str, filename_prefix: Optional[str] = None)
modeling/siglip/tokenization_siglip.py:349
Method
seq_lens
(self)
modeling/bagel/qwen2_navit.py:217
Method
set_decoder
(self, decoder)
modeling/qwen2/modeling_qwen2.py:836
Method
set_decoder
(self, decoder)
modeling/bagel/qwen2_navit.py:1125
← previous
next →
601–700 of 720, ranked by callers