Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Jittor/JittorLLMs
/ functions
Functions
1,370 in github.com/Jittor/JittorLLMs
⨍
Functions
1,370
◇
Types & classes
194
↳
Endpoints
3
↓ 4 callers
Method
convert_tokens_to_ids
Converts a sequence of tokens into ids using the vocab.
models/pangualpha/megatron/tokenizer/gpt2_tokenization.py:247
↓ 4 callers
Method
decode
(self, tokens)
models/pangualpha/megatron/deprecated_data_utils/tokenization_gpt2.py:281
↓ 4 callers
Method
decode
(self, text_ids: List[int], special_tokens=False)
models/chatglm/tokenization_chatglm.py:131
↓ 4 callers
Method
encode
(self, s: str, bos: bool, eos: bool)
models/llama/llama/tokenizer.py:30
↓ 4 callers
Function
evaluate_and_print_results
Helper function to evaluate and dump results on screen.
models/pangualpha/megatron/training.py:463
↓ 4 callers
Function
get_batch
Generate batch from context tokens.
models/pangualpha/megatron/text_generation_utils.py:32
↓ 4 callers
Function
get_indexed_dataset_
(data_prefix, data_impl, skip_warmup)
models/pangualpha/megatron/data/dataset_utils.py:455
↓ 4 callers
Function
get_lazy_path
Gets directory path where lazy files are stored.
models/pangualpha/megatron/deprecated_data_utils/lazy_loader.py:26
↓ 4 callers
Function
model_provider
Build the model.
models/pangualpha/tasks/race/finetune.py:40
↓ 4 callers
Function
read_longs
(f, n)
models/pangualpha/megatron/data/indexed_dataset.py:82
↓ 4 callers
Function
reduce_losses
Reduce a tensor of losses across all GPUs.
models/pangualpha/megatron/utils.py:31
↓ 4 callers
Method
reset
Set to the initial state (no tracker).
models/pangualpha/megatron/mpu/random.py:142
↓ 4 callers
Method
set_command_tokens
(self, command_tokens)
models/pangualpha/megatron/deprecated_data_utils/tokenization.py:74
↓ 4 callers
Method
state_dict_for_save_checkpoint
For easy load.
models/pangualpha/megatron/model/language_model.py:182
↓ 4 callers
Function
write_longs
(f, a)
models/pangualpha/megatron/data/indexed_dataset.py:88
↓ 3 callers
Method
__init__
(self, hidden_size, init_method)
models/pangualpha/megatron/model/language_model.py:81
↓ 3 callers
Function
_ensure_var_is_initialized
Make sure the input variable is not None.
models/pangualpha/megatron/global_vars.py:145
↓ 3 callers
Function
_gather
Gather tensors and concatinate along the last dimension.
models/pangualpha/megatron/mpu/mappings.py:54
↓ 3 callers
Method
_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 callers
Method
_get_stopping_criteria
( self, generation_config: dict, )
models/qwen2/qwen2_jt/utils.py:484
↓ 3 callers
Method
_get_text_tokenizer
(self, encode_special_tokens=False)
models/chatglm/tokenization_chatglm.py:73
↓ 3 callers
Function
_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 callers
Function
_initialize_affine_weight_gpu
Initialize affine weight for model parallel on GPU.
models/pangualpha/megatron/mpu/layers.py:71
↓ 3 callers
Function
_reduce
All-reduce the the input tensor across model parallel group.
models/pangualpha/megatron/mpu/mappings.py:22
↓ 3 callers
Function
_split
Split the tensor along its last dimension and keep the corresponding slice.
models/pangualpha/megatron/mpu/mappings.py:35
↓ 3 callers
Method
_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 callers
Function
apply_rotary_pos_emb_index
(q, k, cos, sin, position_id)
models/chatglm/modeling_chatglm.py:234
↓ 3 callers
Function
bias_dropout_add
(x, bias, residual, prob, training)
models/pangualpha/megatron/model/transformer.py:566
↓ 3 callers
Function
build_dataset
(index, name)
models/pangualpha/megatron/data/gpt2_dataset.py:54
↓ 3 callers
Function
build_dataset
(index, name)
models/pangualpha/megatron/data/dataset_utils.py:400
↓ 3 callers
Function
build_tokenizer
Initialize tokenizer.
models/pangualpha/megatron/tokenizer/tokenizer.py:25
↓ 3 callers
Method
clear
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 callers
Function
compile_helper
Compile helper function ar runtime. Make sure this is invoked on a single process.
models/pangualpha/megatron/data/dataset_utils.py:34
↓ 3 callers
Function
convert_to_unicode
Converts `text` to Unicode (if it's not already), assuming utf-8 input.
models/pangualpha/megatron/tokenizer/bert_tokenization.py:78
↓ 3 callers
Function
detach
(tensor)
models/pangualpha/megatron/data/realm_index.py:13
↓ 3 callers
Method
elapsed
Calculate the elapsed time.
models/pangualpha/megatron/global_vars.py:183
↓ 3 callers
Method
encode
(self, text)
models/pangualpha/megatron/tokenizer/gpt2_tokenization.py:280
↓ 3 callers
Method
generate
( self, prompts: List[str], max_gen_len: int, temperature: float = 0.8,
models/llama/llama/generation.py:23
↓ 3 callers
Method
get_blank_token
(length: int)
models/chatglm/tokenization_chatglm.py:80
↓ 3 callers
Function
get_ltor_masks_and_position_ids
Build masks and position id for left to right model.
models/pangualpha/megatron/utils.py:118
↓ 3 callers
Method
get_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 callers
Method
get_tab_token
()
models/chatglm/tokenization_chatglm.py:85
↓ 3 callers
Function
get_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 callers
Function
get_token_stream
(model, context_tokens)
models/pangualpha/megatron/text_generation_utils.py:288
↓ 3 callers
Function
make_data_loader
Buld dataloader given an input dataset.
models/pangualpha/megatron/utils.py:92
↓ 3 callers
Function
make_data_loader
(dataset, batch_size, args)
models/pangualpha/megatron/deprecated_data_utils/configure_data.py:48
↓ 3 callers
Function
pad_batch
(batch, pad_id, args)
models/pangualpha/megatron/text_generation_utils.py:277
↓ 3 callers
Function
pretrain
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 callers
Function
print_split_stats
(name, index)
models/pangualpha/megatron/data/gpt2_dataset.py:45
↓ 3 callers
Function
print_split_stats
(name, index)
models/pangualpha/megatron/data/dataset_utils.py:386
↓ 3 callers
Method
set_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 callers
Method
step
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 callers
Function
whitespace_tokenize
Runs basic whitespace cleaning and splitting on a piece of text.
models/pangualpha/megatron/deprecated_data_utils/wordpiece.py:65
↓ 3 callers
Function
whitespace_tokenize
Runs basic whitespace cleaning and splitting on a piece of text.
models/pangualpha/megatron/tokenizer/bert_tokenization.py:152
↓ 3 callers
Method
writer
(cls, path, dtype)
models/pangualpha/megatron/data/indexed_dataset.py:340
↓ 2 callers
Method
IdToToken
ascii index to character
models/pangualpha/megatron/deprecated_data_utils/tokenization.py:523
↓ 2 callers
Method
__init__
(self, path)
models/pangualpha/megatron/data/indexed_dataset.py:131
↓ 2 callers
Method
__init__
(self, name, token, Id)
models/pangualpha/megatron/deprecated_data_utils/tokenization.py:182
↓ 2 callers
Method
__init__
(self, name)
models/pangualpha/megatron/tokenizer/tokenizer.py:73
↓ 2 callers
Method
__init__
(self, input_size, output_size, bias=True, input_is_parallel=False, init_met
models/pangualpha/megatron/mpu/layers.py:318
↓ 2 callers
Method
__iter__
(self)
models/pangualpha/megatron/data/samplers.py:61
↓ 2 callers
Method
_batch
extracts samples only pertaining to this worker's batch
models/pangualpha/megatron/data/samplers.py:142
↓ 2 callers
Method
_batch
extracts samples only pertaining to this worker's batch
models/pangualpha/megatron/deprecated_data_utils/samplers.py:139
↓ 2 callers
Method
_build_text_tokenizer
(self, encode_special_tokens=False)
models/chatglm/tokenization_chatglm.py:66
↓ 2 callers
Function
_build_tokenizer
Initialize tokenizer.
models/pangualpha/megatron/global_vars.py:87
↓ 2 callers
Method
_do_init
(self, path, skip_warmup)
models/pangualpha/megatron/data/indexed_dataset.py:460
↓ 2 callers
Method
_get_layer
(self, layer_number)
models/pangualpha/megatron/model/transformer.py:866
↓ 2 callers
Method
_master_params_to_model_params
(self)
models/pangualpha/megatron/fp16/fp16.py:307
↓ 2 callers
Method
_preprocess
(self, text: str, linebreak=True, whitespaces=True)
models/chatglm/tokenization_chatglm.py:107
↓ 2 callers
Method
_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 callers
Method
_set_cos_sin_cache
(self, seq_len, device, dtype)
models/atom7b/modeling_llama.py:116
↓ 2 callers
Method
_update_scale
(self, has_overflow=False)
models/pangualpha/megatron/fp16/fp16.py:304
↓ 2 callers
Function
_warmup_mmap_file
(path)
models/pangualpha/megatron/data/indexed_dataset.py:329
↓ 2 callers
Function
accuracy_func_provider
Provide function that calculates accuracies.
models/pangualpha/tasks/eval_utils.py:30
↓ 2 callers
Method
add_tokens
Copied from `PreTrainedTokenizerBase.add_tokens`
models/qwen2/qwen2_jt/tokenization_utils_fast.py:248
↓ 2 callers
Function
allocate_mem_buff
Allocate a memory buffer.
models/pangualpha/megatron/memory.py:24
↓ 2 callers
Function
apply_threshold
(preds, t)
models/pangualpha/tasks/ensemble_classifier.py:60
↓ 2 callers
Method
backward
: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 callers
Method
bpe
(self, token)
models/pangualpha/megatron/deprecated_data_utils/tokenization_gpt2.py:193
↓ 2 callers
Function
build_sample
Convert to numpy and return a sample consumed by the batch producer.
models/pangualpha/tasks/data_utils.py:33
↓ 2 callers
Function
build_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 callers
Function
build_train_valid_test_datasets
(data_prefix, data_impl, splits_string, train_valid_test_num_samples,
models/pangualpha/megatron/data/dataset_utils.py:357
↓ 2 callers
Method
chat_completion
( self, dialogs: List[Dialog], temperature: float = 0.6, top_p: float = 0.9,
models/llama/llama/generation2.py:155
↓ 2 callers
Function
check
(group, world_size, rank)
models/pangualpha/megatron/mpu/tests/test_initialize.py:36
↓ 2 callers
Function
check_adlr_autoresume_termination
Check for autoresume signal and exit if it is received.
models/pangualpha/megatron/utils.py:75
↓ 2 callers
Method
check_index
(self, i)
models/pangualpha/megatron/data/indexed_dataset.py:158
↓ 2 callers
Function
code
(dtype)
models/pangualpha/megatron/data/indexed_dataset.py:104
↓ 2 callers
Function
concat_partitions
(partitions_)
models/pangualpha/mergeMpCkpt.py:73
↓ 2 callers
Function
concat_partitions
(partitions_)
models/pangualpha/tools/merge_mp_partitions.py:63
↓ 2 callers
Function
conversion_helper
Apply conversion to val. Recursively apply conversion if `val` is a nested tuple/list structure.
models/pangualpha/megatron/fp16/fp16.py:34
↓ 2 callers
Function
convert_tf_example_to_torch_tensors
(example)
models/pangualpha/megatron/deprecated_data_utils/tf_dl.py:93
↓ 2 callers
Method
data_iterator
iterates through data and handles wrap around
models/pangualpha/megatron/deprecated_data_utils/samplers.py:129
↓ 2 callers
Method
decode
(self, tokens)
models/pangualpha/megatron/tokenizer/tokenization_jieba.py:91
↓ 2 callers
Method
embed_block
Embed a batch of tokens using the block model
models/pangualpha/megatron/model/realm_model.py:81
↓ 2 callers
Function
ensure_divisibility
Ensure that numerator is divisible by the denominator.
models/pangualpha/megatron/mpu/utils.py:20
↓ 2 callers
Function
extract_weight_to_half
(weight: torch.Tensor, scale_list: torch.Tensor, source_bit_width: int)
models/chatglm/quantization.py:88
↓ 2 callers
Method
file_read
read specified portion of file
models/pangualpha/megatron/deprecated_data_utils/lazy_loader.py:182
↓ 2 callers
Function
finetune
Main finetune function used across all tasks.
models/pangualpha/tasks/finetune_utils.py:201
↓ 2 callers
Method
forward
Run a forward pass for each of the models and return the respective embeddings.
models/pangualpha/megatron/model/realm_model.py:66
↓ 2 callers
Method
forward
(self, token, state)
models/chatrwkv/RWKV_in_150_lines.py:95
← previous
next →
101–200 of 1,370, ranked by callers