MCPcopy Create free account

hub / github.com/OpenMOSS/MOSS / functions

Functions130 in github.com/OpenMOSS/MOSS

↓ 6 callersMethoddecode
Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special tokens and clean up tokeniz
models/tokenization_moss.py:310
↓ 5 callersMethod__init__
(self, intermediate_size, config)
models/modeling_moss.py:231
↓ 4 callersMethod__init__
(self, intermediate_size, config)
models_jittor/model.py:179
↓ 4 callersFunctionapply_rotary_pos_emb
(x, sincos, offset=0)
models_jittor/utils.py:45
↓ 4 callersFunctionapply_rotary_pos_emb
(tensor: torch.Tensor, sin: torch.Tensor, cos: torch.Tensor)
models/modeling_moss.py:55
↓ 3 callersMethod_split_heads
(self, x, n_head, dim_head, mp_num)
models_jittor/model.py:44
↓ 3 callersMethod_split_heads
(self, x, n_head, dim_head, mp_num)
models/modeling_moss.py:92
↓ 3 callersMethodupdate
(self, logits, labels, loss)
finetune_moss.py:138
↓ 2 callersFunctionfixed_pos_embedding
(x, seq_dim=1, seq_len=None)
models_jittor/utils.py:16
↓ 2 callersMethodget_metric
(self, reset=True)
finetune_moss.py:147
↓ 2 callersFunctionget_pairs
Return set of symbol pairs in a word. Word is represented as tuple of symbols (symbols being variable-length strings).
models/tokenization_moss.py:86
↓ 2 callersFunctionparse_text
copy from https://github.com/GaiZhenbiao/ChuanhuChatGPT/
moss_web_demo_gradio.py:82
↓ 2 callersMethodprune_configs
(self, kwargs)
models/custom_autotune.py:104
↓ 2 callersMethodrun
(self, *args, **kwargs)
models/custom_autotune.py:75
↓ 1 callersMethodInit_Model_Parallelism
Initializes model parallelism for the given model and device map. Args: raw_model_dir (str): The directory containing th
moss_inference.py:87
↓ 1 callersMethod__init__
(self, device)
finetune_moss.py:128
↓ 1 callersMethod_attn
( self, query, key, value, attention_mask=None, head_mask=None
models_jittor/model.py:62
↓ 1 callersMethod_attn
( self, query, key, value, attention_mask=None, head_mask=None
models/modeling_moss.py:110
↓ 1 callersMethod_bench
(self, *args, config, **meta)
models/custom_autotune.py:51
↓ 1 callersFunction_convert_head_mask_to_5d
-> [num_hidden_layers x batch x num_heads x seq_length x seq_length]
models_jittor/utils.py:65
↓ 1 callersMethod_merge_heads
Merges attn_head_size dim and num_attn_heads dim into n_ctx
models_jittor/model.py:49
↓ 1 callersMethod_merge_heads
Merges attn_head_size dim and num_attn_heads dim into n_ctx
models/modeling_moss.py:97
↓ 1 callersMethodbackward
(ctx, grad_output)
models/quantization.py:286
↓ 1 callersMethodbpe
(self, token)
models/tokenization_moss.py:196
↓ 1 callersFunctionbytes_to_unicode
Returns list of utf-8 byte and a mapping to unicode strings. We specifically avoids mapping to whitespace/control characters the bpe code bar
models/tokenization_moss.py:62
↓ 1 callersFunctionclear
()
moss_cli_demo_jittor.py:46
↓ 1 callersFunctionclear
()
moss_cli_demo.py:50
↓ 1 callersFunctioncreate_sinusoidal_positions
(num_pos: int, dim: int)
models/modeling_moss.py:40
↓ 1 callersFunctionduplicate_interleave
A simple version of `jt.repeat_interleave` for duplicating a matrix while interleaving the copy.
models_jittor/utils.py:34
↓ 1 callersFunctionfind_layers
(module, layers=[nn.Conv2d, nn.Linear], name='')
models/quantization.py:11
↓ 1 callersMethodforward
Generates text using the model, given the input data and generation parameters. Args: data (str): The input text for gen
moss_inference.py:144
↓ 1 callersFunctiongenerate
Choose different methods to generate sentences. :param input_str: The input text. :param tokenizer: Tokenizer. :param method: Genera
models_jittor/generation.py:3
↓ 1 callersFunctionget_head_mask
( head_mask, num_hidden_layers: int, is_attention_chunked: bool = False )
models_jittor/utils.py:76
↓ 1 callersFunctiongreedy_search
(model, input_str, tokenizer, max_gen_len, eos_token_id=None, pad_token_id=None)
models_jittor/generation.py:25
↓ 1 callersMethodinfer_
Inference method that computes logits and past key values. Args: input_ids (torch.Tensor): The input IDs tensor.
moss_inference.py:315
↓ 1 callersMethodload_data
(self)
finetune_moss.py:40
↓ 1 callersFunctionload_from_map
(model: jt.Module, ckpt_dir, file_weight_map)
models_jittor/load.py:29
↓ 1 callersFunctionload_from_torch_shard_ckpt
Load sharded checkpoints directly from huggingface dir.
models_jittor/load.py:9
↓ 1 callersFunctionload_model
()
moss_web_demo_streamlit.py:47
↓ 1 callersFunctionmain
()
moss_cli_demo_jittor.py:49
↓ 1 callersFunctionmain
()
moss_cli_demo.py:53
↓ 1 callersFunctionmake_quant
(module, names, bits, groupsize, name='')
models/quantization.py:372
↓ 1 callersFunctionmatmul248
(input, qweight, scales, qzeros, g_idx, bits, maxq)
models/quantization.py:246
↓ 1 callersMethodpostprocess_remove_prefix
Removes the prefix from the generated text. Args: preds_i (str): The generated text containing the prefix. Retu
moss_inference.py:181
↓ 1 callersMethodpreprocess
Preprocesses the raw input text by adding the prefix and tokenizing it. Args: raw_text (str): The raw input text.
moss_inference.py:127
↓ 1 callersMethodquantize
(self, wbits, groupsize)
models/modeling_moss.py:735
↓ 1 callersFunctionquantize_with_gptq
(model, wbits, groupsize)
models/quantization.py:385
↓ 1 callersFunctionrotate_every_two
(x)
models_jittor/utils.py:28
↓ 1 callersFunctionrotate_every_two
(x: torch.Tensor)
models/modeling_moss.py:47
↓ 1 callersFunctionsample
(model, input_str, tokenizer, max_gen_len, temperature, top_p, top_k, eos_token_id=None, pad_token_
models_jittor/generation.py:76
↓ 1 callersFunctionsample_top_k
(scores, top_k)
models_jittor/generation.py:138
↓ 1 callersFunctionsample_top_p
(scores, top_p)
models_jittor/generation.py:146
↓ 1 callersMethodstreaming_topk_search
Performs a streaming top-k search using the given parameters. Args: input_ids (torch.Tensor): The input IDs tensor.
moss_inference.py:193
↓ 1 callersMethodtop_k_top_p_filtering
(self, logits, top_k, top_p, filter_value=-float("Inf"), min_tokens_to_keep=1, )
moss_inference.py:291
↓ 1 callersFunctiontrain
(args)
finetune_moss.py:163
↓ 1 callersFunctiontranspose_matmul248
(input, qweight, scales, qzeros, g_idx, bits, maxq)
models/quantization.py:260
↓ 1 callersMethodtruncate
(self, completion, truncate_before_pattern)
models/tokenization_moss.py:354
Method__call__
(self, logits, labels, loss)
finetune_moss.py:135
Method__call__
(self, input_ids: torch.LongTensor, scores: torch.FloatTensor, **kwargs)
utils.py:10
Method__call__
(self, input)
moss_inference.py:342
Method__getitem__
(self, index)
finetune_moss.py:100
Method__init__
(self, data_dir, tokenizer, data_type='train')
finetune_moss.py:26
Method__init__
(self, stop_indices: list)
utils.py:7
Method__init__
Initializes the MossModel with a given model or loads a model from the specified directory. Args: model (Optional[MossFo
moss_inference.py:45
Method__init__
(self, config)
models_jittor/model.py:13
Method__init__
(self, config)
models_jittor/model.py:199
Method__init__
(self, config)
models_jittor/model.py:239
Method__init__
(self, config)
models_jittor/model.py:349
Method__init__
( self, vocab_size=107008, n_positions=2048, n_ctx=2048, n_embd=4096,
models/configuration_moss.py:75
Method__init__
(self, config)
models/modeling_moss.py:62
Method__init__
(self, config)
models/modeling_moss.py:251
Method__init__
(self, *inputs, **kwargs)
models/modeling_moss.py:304
Method__init__
(self, config)
models/modeling_moss.py:394
Method__init__
(self, config)
models/modeling_moss.py:589
Method__init__
:param prune_configs_by: a dict of functions that are used to prune configs, fields: 'perf_model': performance model used to predicate running t
models/custom_autotune.py:15
Method__init__
(self, bits, groupsize, infeatures, outfeatures, bias)
models/quantization.py:296
Method__init__
( self, vocab_file, merges_file, errors="replace", unk_token="<|endoft
models/tokenization_moss.py:144
Method__len__
(self)
finetune_moss.py:97
Method_convert_id_to_token
Converts an index (integer) in a token (str) using the vocab.
models/tokenization_moss.py:265
Method_convert_token_to_id
Converts a token (str) in an id using the vocab.
models/tokenization_moss.py:261
Method_hook
(args)
models/custom_autotune.py:35
Function_init_weights
(module, config)
models_jittor/utils.py:50
Method_init_weights
Initialize the weights.
models/modeling_moss.py:307
Method_reorder_cache
This function is used to re-order the `past_key_values` cache if [`~PretrainedModel.beam_search`] or [`~PretrainedModel.beam_sample`]
models/modeling_moss.py:722
Method_set_gradient_checkpointing
(self, module, value=False)
models/modeling_moss.py:323
Method_tokenize
Tokenize a string.
models/tokenization_moss.py:251
Functionautotune
Decorator for auto-tuning a :code:`triton.jit`'d function. .. highlight:: python .. code-block:: python @triton.autotune(configs=[ triton.Con
models/custom_autotune.py:134
Methodbuild_inputs_with_special_tokens
(self, token_ids_0, token_ids_1=None)
models/tokenization_moss.py:238
Functioncheck_state_dict
(model: jt.Module, ckpt_dir, file_weight_map)
models_jittor/load.py:48
Functionclear_history
()
moss_web_demo_streamlit.py:126
Methodcollate_fn
(self, batch)
finetune_moss.py:113
Methodconvert_tokens_to_string
Converts a sequence of tokens (string) in a single string.
models/tokenization_moss.py:269
Methodcreate_custom_forward
(module)
models/modeling_moss.py:529
Functioncreate_item
(request: Request)
moss_api_demo.py:72
Methodcustom_forward
(*inputs)
models/modeling_moss.py:530
Functiondecorator
(fn)
models/custom_autotune.py:164
Methodexecute
(self, input)
models_jittor/utils.py:8
Methodexecute
( self, hidden_states: Optional[jt.Var], attention_mask: Optional[jt.Var] = None,
models_jittor/model.py:104
Methodexecute
(self, hidden_states: Optional[jt.Var])
models_jittor/model.py:190
Methodexecute
( self, hidden_states: Optional[jt.Var], layer_past: Optional[Tuple[jt.Var]] = None,
models_jittor/model.py:207
next →1–100 of 130, ranked by callers