MCPcopy Create free account

hub / github.com/Jittor/JittorLLMs / functions

Functions1,370 in github.com/Jittor/JittorLLMs

↓ 4 callersMethodconvert_tokens_to_ids
Converts a sequence of tokens into ids using the vocab.
models/pangualpha/megatron/tokenizer/gpt2_tokenization.py:247
↓ 4 callersMethoddecode
(self, tokens)
models/pangualpha/megatron/deprecated_data_utils/tokenization_gpt2.py:281
↓ 4 callersMethoddecode
(self, text_ids: List[int], special_tokens=False)
models/chatglm/tokenization_chatglm.py:131
↓ 4 callersMethodencode
(self, s: str, bos: bool, eos: bool)
models/llama/llama/tokenizer.py:30
↓ 4 callersFunctionevaluate_and_print_results
Helper function to evaluate and dump results on screen.
models/pangualpha/megatron/training.py:463
↓ 4 callersFunctionget_batch
Generate batch from context tokens.
models/pangualpha/megatron/text_generation_utils.py:32
↓ 4 callersFunctionget_indexed_dataset_
(data_prefix, data_impl, skip_warmup)
models/pangualpha/megatron/data/dataset_utils.py:455
↓ 4 callersFunctionget_lazy_path
Gets directory path where lazy files are stored.
models/pangualpha/megatron/deprecated_data_utils/lazy_loader.py:26
↓ 4 callersFunctionmodel_provider
Build the model.
models/pangualpha/tasks/race/finetune.py:40
↓ 4 callersFunctionread_longs
(f, n)
models/pangualpha/megatron/data/indexed_dataset.py:82
↓ 4 callersFunctionreduce_losses
Reduce a tensor of losses across all GPUs.
models/pangualpha/megatron/utils.py:31
↓ 4 callersMethodreset
Set to the initial state (no tracker).
models/pangualpha/megatron/mpu/random.py:142
↓ 4 callersMethodset_command_tokens
(self, command_tokens)
models/pangualpha/megatron/deprecated_data_utils/tokenization.py:74
↓ 4 callersMethodstate_dict_for_save_checkpoint
For easy load.
models/pangualpha/megatron/model/language_model.py:182
↓ 4 callersFunctionwrite_longs
(f, a)
models/pangualpha/megatron/data/indexed_dataset.py:88
↓ 3 callersMethod__init__
(self, hidden_size, init_method)
models/pangualpha/megatron/model/language_model.py:81
↓ 3 callersFunction_ensure_var_is_initialized
Make sure the input variable is not None.
models/pangualpha/megatron/global_vars.py:145
↓ 3 callersFunction_gather
Gather tensors and concatinate along the last dimension.
models/pangualpha/megatron/mpu/mappings.py:54
↓ 3 callersMethod_get_logits_processor
This class returns a [`LogitsProcessorList`] list object that contains all relevant [`LogitsProcessor`] instances used to modify the
models/qwen2/qwen2_jt/utils.py:456
↓ 3 callersMethod_get_stopping_criteria
( self, generation_config: dict, )
models/qwen2/qwen2_jt/utils.py:484
↓ 3 callersMethod_get_text_tokenizer
(self, encode_special_tokens=False)
models/chatglm/tokenization_chatglm.py:73
↓ 3 callersFunction_initialize_affine_weight_cpu
Initialize affine weight for model parallel. Build the master weight on all processes and scatter the relevant chunk.
models/pangualpha/megatron/mpu/layers.py:84
↓ 3 callersFunction_initialize_affine_weight_gpu
Initialize affine weight for model parallel on GPU.
models/pangualpha/megatron/mpu/layers.py:71
↓ 3 callersFunction_reduce
All-reduce the the input tensor across model parallel group.
models/pangualpha/megatron/mpu/mappings.py:22
↓ 3 callersFunction_split
Split the tensor along its last dimension and keep the corresponding slice.
models/pangualpha/megatron/mpu/mappings.py:35
↓ 3 callersMethod_update_model_kwargs_for_generation
( self, model_kwargs: Dict[str, Any], is_encoder_decoder: bool = False, num_ne
models/qwen2/qwen2_jt/utils.py:431
↓ 3 callersFunctionapply_rotary_pos_emb_index
(q, k, cos, sin, position_id)
models/chatglm/modeling_chatglm.py:234
↓ 3 callersFunctionbias_dropout_add
(x, bias, residual, prob, training)
models/pangualpha/megatron/model/transformer.py:566
↓ 3 callersFunctionbuild_dataset
(index, name)
models/pangualpha/megatron/data/gpt2_dataset.py:54
↓ 3 callersFunctionbuild_dataset
(index, name)
models/pangualpha/megatron/data/dataset_utils.py:400
↓ 3 callersFunctionbuild_tokenizer
Initialize tokenizer.
models/pangualpha/megatron/tokenizer/tokenizer.py:25
↓ 3 callersMethodclear
Clear the embedding data structures to save memory. The metadata ends up getting used, and is also much smaller in dimensionality so i
models/pangualpha/megatron/data/realm_index.py:41
↓ 3 callersFunctioncompile_helper
Compile helper function ar runtime. Make sure this is invoked on a single process.
models/pangualpha/megatron/data/dataset_utils.py:34
↓ 3 callersFunctionconvert_to_unicode
Converts `text` to Unicode (if it's not already), assuming utf-8 input.
models/pangualpha/megatron/tokenizer/bert_tokenization.py:78
↓ 3 callersFunctiondetach
(tensor)
models/pangualpha/megatron/data/realm_index.py:13
↓ 3 callersMethodelapsed
Calculate the elapsed time.
models/pangualpha/megatron/global_vars.py:183
↓ 3 callersMethodencode
(self, text)
models/pangualpha/megatron/tokenizer/gpt2_tokenization.py:280
↓ 3 callersMethodgenerate
( self, prompts: List[str], max_gen_len: int, temperature: float = 0.8,
models/llama/llama/generation.py:23
↓ 3 callersMethodget_blank_token
(length: int)
models/chatglm/tokenization_chatglm.py:80
↓ 3 callersFunctionget_ltor_masks_and_position_ids
Build masks and position id for left to right model.
models/pangualpha/megatron/utils.py:118
↓ 3 callersMethodget_states
Get rng states. Copy the dictionary so we have direct pointers to the states, not just a pointer to the dictionary.
models/pangualpha/megatron/mpu/random.py:147
↓ 3 callersMethodget_tab_token
()
models/chatglm/tokenization_chatglm.py:85
↓ 3 callersFunctionget_tensorboard_writer
Return tensorboard writer. It can be None so no need to check if it is initialized.
models/pangualpha/megatron/global_vars.py:46
↓ 3 callersFunctionget_token_stream
(model, context_tokens)
models/pangualpha/megatron/text_generation_utils.py:288
↓ 3 callersFunctionmake_data_loader
Buld dataloader given an input dataset.
models/pangualpha/megatron/utils.py:92
↓ 3 callersFunctionmake_data_loader
(dataset, batch_size, args)
models/pangualpha/megatron/deprecated_data_utils/configure_data.py:48
↓ 3 callersFunctionpad_batch
(batch, pad_id, args)
models/pangualpha/megatron/text_generation_utils.py:277
↓ 3 callersFunctionpretrain
Main training program. This function will run the followings in the order provided: 1) initialize Megatron. 2) setup model, optim
models/pangualpha/megatron/training.py:44
↓ 3 callersFunctionprint_split_stats
(name, index)
models/pangualpha/megatron/data/gpt2_dataset.py:45
↓ 3 callersFunctionprint_split_stats
(name, index)
models/pangualpha/megatron/data/dataset_utils.py:386
↓ 3 callersMethodset_states
Set the rng states. For efficiency purposes, we do not check the size of seed for compatibility.
models/pangualpha/megatron/mpu/random.py:155
↓ 3 callersMethodstep
If no closure is supplied, :attr:`step` should be called after ``fp16_optimizer_obj.backward(loss)``. :attr:`step` updates th
models/pangualpha/megatron/fp16/fp16.py:420
↓ 3 callersFunctionwhitespace_tokenize
Runs basic whitespace cleaning and splitting on a piece of text.
models/pangualpha/megatron/deprecated_data_utils/wordpiece.py:65
↓ 3 callersFunctionwhitespace_tokenize
Runs basic whitespace cleaning and splitting on a piece of text.
models/pangualpha/megatron/tokenizer/bert_tokenization.py:152
↓ 3 callersMethodwriter
(cls, path, dtype)
models/pangualpha/megatron/data/indexed_dataset.py:340
↓ 2 callersMethodIdToToken
ascii index to character
models/pangualpha/megatron/deprecated_data_utils/tokenization.py:523
↓ 2 callersMethod__init__
(self, path)
models/pangualpha/megatron/data/indexed_dataset.py:131
↓ 2 callersMethod__init__
(self, name, token, Id)
models/pangualpha/megatron/deprecated_data_utils/tokenization.py:182
↓ 2 callersMethod__init__
(self, name)
models/pangualpha/megatron/tokenizer/tokenizer.py:73
↓ 2 callersMethod__init__
(self, input_size, output_size, bias=True, input_is_parallel=False, init_met
models/pangualpha/megatron/mpu/layers.py:318
↓ 2 callersMethod__iter__
(self)
models/pangualpha/megatron/data/samplers.py:61
↓ 2 callersMethod_batch
extracts samples only pertaining to this worker's batch
models/pangualpha/megatron/data/samplers.py:142
↓ 2 callersMethod_batch
extracts samples only pertaining to this worker's batch
models/pangualpha/megatron/deprecated_data_utils/samplers.py:139
↓ 2 callersMethod_build_text_tokenizer
(self, encode_special_tokens=False)
models/chatglm/tokenization_chatglm.py:66
↓ 2 callersFunction_build_tokenizer
Initialize tokenizer.
models/pangualpha/megatron/global_vars.py:87
↓ 2 callersMethod_do_init
(self, path, skip_warmup)
models/pangualpha/megatron/data/indexed_dataset.py:460
↓ 2 callersMethod_get_layer
(self, layer_number)
models/pangualpha/megatron/model/transformer.py:866
↓ 2 callersMethod_master_params_to_model_params
(self)
models/pangualpha/megatron/fp16/fp16.py:307
↓ 2 callersMethod_preprocess
(self, text: str, linebreak=True, whitespaces=True)
models/chatglm/tokenization_chatglm.py:107
↓ 2 callersMethod_set_block_index
Create a Faiss Flat index with inner product as the metric to search against
models/pangualpha/megatron/data/realm_index.py:126
↓ 2 callersMethod_set_cos_sin_cache
(self, seq_len, device, dtype)
models/atom7b/modeling_llama.py:116
↓ 2 callersMethod_update_scale
(self, has_overflow=False)
models/pangualpha/megatron/fp16/fp16.py:304
↓ 2 callersFunction_warmup_mmap_file
(path)
models/pangualpha/megatron/data/indexed_dataset.py:329
↓ 2 callersFunctionaccuracy_func_provider
Provide function that calculates accuracies.
models/pangualpha/tasks/eval_utils.py:30
↓ 2 callersMethodadd_tokens
Copied from `PreTrainedTokenizerBase.add_tokens`
models/qwen2/qwen2_jt/tokenization_utils_fast.py:248
↓ 2 callersFunctionallocate_mem_buff
Allocate a memory buffer.
models/pangualpha/megatron/memory.py:24
↓ 2 callersFunctionapply_threshold
(preds, t)
models/pangualpha/tasks/ensemble_classifier.py:60
↓ 2 callersMethodbackward
:attr:`backward` performs the following conceptual steps: 1. fp32_loss = loss.float() (see first Note below) 2. scaled_loss
models/pangualpha/megatron/fp16/fp16.py:515
↓ 2 callersMethodbpe
(self, token)
models/pangualpha/megatron/deprecated_data_utils/tokenization_gpt2.py:193
↓ 2 callersFunctionbuild_sample
Convert to numpy and return a sample consumed by the batch producer.
models/pangualpha/tasks/data_utils.py:33
↓ 2 callersFunctionbuild_tokens_types_paddings_from_ids
Build token types and paddings, trim if needed, and pad if needed.
models/pangualpha/tasks/data_utils.py:62
↓ 2 callersFunctionbuild_train_valid_test_datasets
(data_prefix, data_impl, splits_string, train_valid_test_num_samples,
models/pangualpha/megatron/data/dataset_utils.py:357
↓ 2 callersMethodchat_completion
( self, dialogs: List[Dialog], temperature: float = 0.6, top_p: float = 0.9,
models/llama/llama/generation2.py:155
↓ 2 callersFunctioncheck
(group, world_size, rank)
models/pangualpha/megatron/mpu/tests/test_initialize.py:36
↓ 2 callersFunctioncheck_adlr_autoresume_termination
Check for autoresume signal and exit if it is received.
models/pangualpha/megatron/utils.py:75
↓ 2 callersMethodcheck_index
(self, i)
models/pangualpha/megatron/data/indexed_dataset.py:158
↓ 2 callersFunctioncode
(dtype)
models/pangualpha/megatron/data/indexed_dataset.py:104
↓ 2 callersFunctionconcat_partitions
(partitions_)
models/pangualpha/mergeMpCkpt.py:73
↓ 2 callersFunctionconcat_partitions
(partitions_)
models/pangualpha/tools/merge_mp_partitions.py:63
↓ 2 callersFunctionconversion_helper
Apply conversion to val. Recursively apply conversion if `val` is a nested tuple/list structure.
models/pangualpha/megatron/fp16/fp16.py:34
↓ 2 callersFunctionconvert_tf_example_to_torch_tensors
(example)
models/pangualpha/megatron/deprecated_data_utils/tf_dl.py:93
↓ 2 callersMethoddata_iterator
iterates through data and handles wrap around
models/pangualpha/megatron/deprecated_data_utils/samplers.py:129
↓ 2 callersMethoddecode
(self, tokens)
models/pangualpha/megatron/tokenizer/tokenization_jieba.py:91
↓ 2 callersMethodembed_block
Embed a batch of tokens using the block model
models/pangualpha/megatron/model/realm_model.py:81
↓ 2 callersFunctionensure_divisibility
Ensure that numerator is divisible by the denominator.
models/pangualpha/megatron/mpu/utils.py:20
↓ 2 callersFunctionextract_weight_to_half
(weight: torch.Tensor, scale_list: torch.Tensor, source_bit_width: int)
models/chatglm/quantization.py:88
↓ 2 callersMethodfile_read
read specified portion of file
models/pangualpha/megatron/deprecated_data_utils/lazy_loader.py:182
↓ 2 callersFunctionfinetune
Main finetune function used across all tasks.
models/pangualpha/tasks/finetune_utils.py:201
↓ 2 callersMethodforward
Run a forward pass for each of the models and return the respective embeddings.
models/pangualpha/megatron/model/realm_model.py:66
↓ 2 callersMethodforward
(self, token, state)
models/chatrwkv/RWKV_in_150_lines.py:95
← previousnext →101–200 of 1,370, ranked by callers