MCPcopy Create free account

hub / github.com/declare-lab/resta / functions

Functions581 in github.com/declare-lab/resta

↓ 2 callersFunctionbernoulli
( tensor: torch.Tensor, density: float, rescale: bool = True )
merge/mergekit/sparsify.py:45
↓ 2 callersMethodconcatenated_forward
( self, model: "PreTrainedModel", batch: Dict[str, torch.Tensor] )
sft/src/llmtuner/train/dpo/trainer.py:73
↓ 2 callersFunctioncount_parameters
r""" Returns the number of trainable parameters and number of all parameters in the model.
sft/src/llmtuner/extras/misc.py:59
↓ 2 callersFunctioncreate_app
(chat_model: "ChatModel")
sft/src/llmtuner/api/app.py:65
↓ 2 callersFunctioncreate_chat_box
( engine: "Engine", visible: Optional[bool] = False )
sft/src/llmtuner/webui/components/chatbot.py:15
↓ 2 callersFunctioncreate_preview_box
(dataset_dir: "gr.Textbox", dataset: "gr.Dropdown")
sft/src/llmtuner/webui/components/data.py:57
↓ 2 callersFunctioncreate_ref_model
r""" Creates reference model for PPO/DPO training. Evaluation mode is not supported. The valuehead parameter is randomly initialized since it
sft/src/llmtuner/train/utils.py:42
↓ 2 callersFunctioncreate_ui
(demo_mode: Optional[bool] = False)
sft/src/llmtuner/webui/interface.py:22
↓ 2 callersFunctiondispatch_model
r""" Dispatches a pre-trained model to GPUs with balanced memory when the GPU is available. Borrowed from: https://github.com/huggingface/tran
sft/src/llmtuner/model/utils.py:22
↓ 2 callersFunctiondtype_bytes
Return the number of bytes used to store a single instance of `dtype`.
merge/mergekit/io/lazy_unpickle.py:185
↓ 2 callersMethodencode_multiturn
r""" Returns multiple pairs of token ids representing prompts and responses respectively.
sft/src/llmtuner/data/template.py:53
↓ 2 callersFunctionexport_model
(args: Optional[Dict[str, Any]] = None)
sft/src/llmtuner/train/tuner.py:42
↓ 2 callersMethodextract
(self, content: str)
sft/src/llmtuner/data/formatter.py:80
↓ 2 callersMethodflush_current_shard
(self)
merge/mergekit/io/tensor_writer.py:64
↓ 2 callersMethodfor_out_slice
(self, slice: OutputSliceDefinition)
merge/mergekit/config.py:134
↓ 2 callersMethodfor_tensor
(self, tensor_name: str)
merge/mergekit/config.py:142
↓ 2 callersFunctiongen_prompt
(que)
evaluate/generate_responses.py:157
↓ 2 callersFunctionget_config_path
()
sft/src/llmtuner/webui/common.py:32
↓ 2 callersFunctionget_infer_args
(args: Optional[Dict[str, Any]] = None)
sft/src/llmtuner/hparams/parser.py:246
↓ 2 callersMethodget_scores
(self, batch_input: List[str], **input_kwargs)
sft/src/llmtuner/chat/chat_model.py:142
↓ 2 callersFunctionget_time
()
sft/src/llmtuner/webui/utils.py:33
↓ 2 callersMethodgroup_label
(self)
merge/mergekit/io/tasks.py:86
↓ 2 callersFunctionis_matplotlib_available
()
sft/src/llmtuner/extras/packages.py:28
↓ 2 callersFunctionlist_dataset
( dataset_dir: Optional[str] = None, training_stage: Optional[str] = list(TRAINING_STAGES.keys())[0] )
sft/src/llmtuner/webui/common.py:107
↓ 2 callersFunctionload_valuehead_params
r""" Loads value head parameters from Hugging Face Hub or local disk. Returns: dict with keys `v_head.summary.weight` and `v_head.summary.bia
sft/src/llmtuner/model/utils.py:79
↓ 2 callersFunctionmain
()
sft/src/train_bash.py:4
↓ 2 callersFunctionmaybe_link_hf
Convert a path to a clickable link if it's a Hugging Face model path. Args: path: A string path to possibly convert to a link.
merge/mergekit/card.py:103
↓ 2 callersFunctionmaybe_torch
(v: np.ndarray, is_torch: bool)
merge/mergekit/merge_methods/slerp.py:154
↓ 2 callersFunctionmodelref_md
Generates markdown description for a ModelReference object. Args: model: A ModelReference object. Returns: A markdown f
merge/mergekit/card.py:115
↓ 2 callersFunctionnormalize
(v: np.ndarray, eps: float)
merge/mergekit/merge_methods/slerp.py:160
↓ 2 callersMethodon_train_end
r""" Event called at the end of training.
sft/src/llmtuner/extras/callbacks.py:65
↓ 2 callersMethodparameter
( self, name: str, model: Optional[ModelReference] = None, default: Any = None
merge/mergekit/config.py:158
↓ 2 callersMethodparse_example
(self, example: Dict[str, str])
sft/src/llmtuner/eval/template.py:19
↓ 2 callersFunctionparse_kmb
(value: Union[str, int])
merge/mergekit/common.py:215
↓ 2 callersMethodpredict
( self, chatbot: List[Tuple[str, str]], query: str, messages: Sequence[Tuple[s
sft/src/llmtuner/webui/chatter.py:106
↓ 2 callersMethodpriority
Returns the priority of the task for scheduling. Higher numbers indicate higher priority. Default is 0. Returns:
merge/mergekit/graph.py:82
↓ 2 callersFunctionprompt_tup
(e: Expert)
merge/mergekit/scripts/mixtral_moe.py:229
↓ 2 callersFunctionrectify_embed_sizes
(param_name: str, tensors: List[torch.Tensor])
merge/mergekit/common.py:188
↓ 2 callersFunctionregister_eval_template
(name: str, system: str, choice: str, answer: str, prefix: str)
sft/src/llmtuner/eval/template.py:42
↓ 2 callersFunctionreplace_model
(model: "AutoModelForCausalLMWithValueHead", target: Literal["default", "reward"])
sft/src/llmtuner/train/ppo/utils.py:27
↓ 2 callersFunctionrun_exp
(args: Optional[Dict[str, Any]] = None, callbacks: Optional[List["TrainerCallback"]] = None)
sft/src/llmtuner/train/tuner.py:24
↓ 2 callersFunctionslerp
Spherical linear interpolation From: https://gist.github.com/dvschultz/3af50c40df002da3b751efab1daddf2c Args: t (float/np.ndarra
merge/mergekit/merge_methods/slerp.py:94
↓ 2 callersFunctionsmooth
r""" EMA implementation according to TensorBoard.
sft/src/llmtuner/extras/ploting.py:19
↓ 2 callersMethodtiming
(self)
sft/src/llmtuner/extras/callbacks.py:45
↓ 2 callersFunctiontokenize_prompts
( prompts: List[str], tokenizer: transformers.PreTrainedTokenizerBase )
merge/mergekit/scripts/mixtral_moe.py:112
↓ 1 callersMethod__init__
( self, manager: "Manager", demo_mode: Optional[bool] = False, lazy_init: Optional[bool] = True )
sft/src/llmtuner/webui/chatter.py:20
↓ 1 callersMethod__str__
(self)
merge/mergekit/common.py:64
↓ 1 callersFunction_configure_attn_implementation
(model_args: "ModelArguments", config_kwargs: Dict[str, Any])
sft/src/llmtuner/model/patcher.py:105
↓ 1 callersFunction_configure_longlora
(config: "PretrainedConfig")
sft/src/llmtuner/model/patcher.py:144
↓ 1 callersFunction_configure_quantization
r""" Priority: GPTQ-quantized (training) > AutoGPTQ (export) > Bitsandbytes (training)
sft/src/llmtuner/model/patcher.py:153
↓ 1 callersFunction_configure_rope
(config: "PretrainedConfig", model_args: "ModelArguments", is_trainable: bool)
sft/src/llmtuner/model/patcher.py:117
↓ 1 callersMethod_finalize
(self, lang: str, finish_info: str)
sft/src/llmtuner/webui/runner.py:78
↓ 1 callersFunction_get_donor_tokenizer
( merge_config: MergeConfiguration, trust_remote_code: bool = False )
merge/mergekit/merge.py:127
↓ 1 callersFunction_get_package_version
(name: str)
sft/src/llmtuner/extras/packages.py:9
↓ 1 callersFunction_get_quantization_dataset
r""" Inspired by: https://github.com/huggingface/optimum/blob/v1.16.0/optimum/gptq/data.py#L133 TODO: remove tokenizer.decode() https://github
sft/src/llmtuner/model/patcher.py:75
↓ 1 callersFunction_keep_merge
(m)
merge/mergekit/tokenizer.py:92
↓ 1 callersFunction_load_all_architectures
()
merge/mergekit/architecture.py:294
↓ 1 callersFunction_model_out_config
Return a configuration for the resulting model.
merge/mergekit/merge.py:148
↓ 1 callersFunction_normalized_shard_name
(path: str)
merge/mergekit/io/tasks.py:45
↓ 1 callersMethod_pad_labels
(self, batch: torch.Tensor, positions: List[Tuple[int, int]])
sft/src/llmtuner/train/dpo/collator.py:14
↓ 1 callersMethod_pad_tensors_to_target_len
r""" Pads the tensor to the same length as the target tensor.
sft/src/llmtuner/train/sft/trainer.py:56
↓ 1 callersFunction_parse_eval_args
(args: Optional[Dict[str, Any]] = None)
sft/src/llmtuner/hparams/parser.py:96
↓ 1 callersFunction_parse_infer_args
(args: Optional[Dict[str, Any]] = None)
sft/src/llmtuner/hparams/parser.py:91
↓ 1 callersFunction_parse_train_args
(args: Optional[Dict[str, Any]] = None)
sft/src/llmtuner/hparams/parser.py:86
↓ 1 callersFunction_prepare_model_for_training
r""" Includes: (1) cast the layernorm in fp32 (2) make output embedding layer require grads (3) add the upcasting of the l
sft/src/llmtuner/model/patcher.py:210
↓ 1 callersFunction_resize_embedding_layer
r""" Resize token embeddings.
sft/src/llmtuner/model/patcher.py:42
↓ 1 callersMethod_save_results
(self, category_corrects: Dict[str, np.ndarray], results: Dict[str, Dict[int, str]])
sft/src/llmtuner/eval/evaluator.py:103
↓ 1 callersMethod_save_st
(self, shard_path: str)
merge/mergekit/io/tensor_writer.py:127
↓ 1 callersFunction_update_config_vocab
( config: transformers.PretrainedConfig, tokenizer: transformers.PreTrainedTokenizerBase, )
merge/mergekit/merge.py:177
↓ 1 callersFunctionalign_dataset
r""" Aligned dataset: prompt: [{"role": "user", "content": "..."}] * (2T - 1) response: [{"role": "assistant", "content": "..."}]
sft/src/llmtuner/data/aligner.py:89
↓ 1 callersFunctionannotate_tag
(r)
evaluate/gpt4_as_judge.py:103
↓ 1 callersFunctionapply_llama_patch
()
sft/src/llmtuner/extras/patches/llama_patch.py:195
↓ 1 callersMethodarguments
(self)
merge/mergekit/io/tasks.py:100
↓ 1 callersMethodbatch_inference
(self, batch_input: Dict[str, torch.Tensor])
sft/src/llmtuner/eval/evaluator.py:34
↓ 1 callersFunctionbuild
( config: MistralMOEConfig, out_path: str, merge_options: MergeOptions, load_in_4bit: bool = F
merge/mergekit/scripts/mixtral_moe.py:256
↓ 1 callersFunctionbuild_tokenizer
( base_model: Optional[ModelReference], referenced_models: List[ModelReference], tokenizer_source:
merge/mergekit/tokenizer.py:172
↓ 1 callersFunctionbuild_union_tokenizer
( base_tok: transformers.PreTrainedTokenizerBase, tokenizers: Dict[ModelReference, transformers.PreTra
merge/mergekit/tokenizer.py:106
↓ 1 callersMethodchat
( self, messages: Sequence[Dict[str, str]], system: Optional[str] = None, tool
sft/src/llmtuner/chat/chat_model.py:90
↓ 1 callersFunctionchat_completion
(system, prompt)
evaluate/gpt4_as_judge.py:56
↓ 1 callersFunctionchat_completion_claude
(system, prompt)
evaluate/generate_responses.py:112
↓ 1 callersFunctionchat_completion_gpt
(system, prompt)
evaluate/generate_responses.py:88
↓ 1 callersFunctionchecksum
(data_files: List[str], file_sha1: Optional[str] = None)
sft/src/llmtuner/data/utils.py:27
↓ 1 callersFunctionclean_thoughts_
(response)
evaluate/gpt4_as_judge.py:40
↓ 1 callersFunctioncreate_eval_tab
(engine: "Engine")
sft/src/llmtuner/webui/components/eval.py:15
↓ 1 callersFunctioncreate_export_tab
(engine: "Engine")
sft/src/llmtuner/webui/components/export.py:73
↓ 1 callersFunctioncreate_infer_tab
(engine: "Engine")
sft/src/llmtuner/webui/components/infer.py:14
↓ 1 callersFunctioncreate_reward_model
r""" Creates reward model for PPO training.
sft/src/llmtuner/train/utils.py:77
↓ 1 callersFunctioncreate_top
()
sft/src/llmtuner/webui/components/top.py:15
↓ 1 callersFunctioncreate_train_tab
(engine: "Engine")
sft/src/llmtuner/webui/components/train.py:18
↓ 1 callersFunctioncreate_web_demo
()
sft/src/llmtuner/webui/interface.py:57
↓ 1 callersFunctiondefault_tool_extractor
(content: str)
sft/src/llmtuner/data/formatter.py:56
↓ 1 callersFunctiondefault_tool_formatter
(tools: List[Dict[str, Any]])
sft/src/llmtuner/data/formatter.py:26
↓ 1 callersFunctiondfs
Returns True if a cycle is detected
merge/mergekit/scripts/megamerge.py:28
↓ 1 callersFunctiondump_layernorm
(model: "PreTrainedModel")
sft/src/llmtuner/train/ppo/utils.py:46
↓ 1 callersMethodexecute
Executes the task using the results of its dependencies. The keyword arguments (**kwargs) for this method are dynamically determined
merge/mergekit/graph.py:68
↓ 1 callersMethodexecute
Execute all tasks and discard results.
merge/mergekit/graph.py:212
↓ 1 callersMethodexecute
(self)
merge/mergekit/io/tasks.py:68
↓ 1 callersFunctionextract_hf_paths
Yields all valid Hugging Face paths from a list of ModelReference objects. Args: models: A list of ModelReference objects.
merge/mergekit/card.py:70
↓ 1 callersFunctionfind_all_linear_modules
r""" Finds all available modules to apply lora.
sft/src/llmtuner/model/utils.py:52
↓ 1 callersMethodflush
(self)
merge/mergekit/io/lazy_tensor_loader.py:141
← previousnext →101–200 of 581, ranked by callers