Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/declare-lab/resta
/ functions
Functions
581 in github.com/declare-lab/resta
⨍
Functions
581
◇
Types & classes
136
↳
Endpoints
5
↓ 2 callers
Function
bernoulli
( tensor: torch.Tensor, density: float, rescale: bool = True )
merge/mergekit/sparsify.py:45
↓ 2 callers
Method
concatenated_forward
( self, model: "PreTrainedModel", batch: Dict[str, torch.Tensor] )
sft/src/llmtuner/train/dpo/trainer.py:73
↓ 2 callers
Function
count_parameters
r""" Returns the number of trainable parameters and number of all parameters in the model.
sft/src/llmtuner/extras/misc.py:59
↓ 2 callers
Function
create_app
(chat_model: "ChatModel")
sft/src/llmtuner/api/app.py:65
↓ 2 callers
Function
create_chat_box
( engine: "Engine", visible: Optional[bool] = False )
sft/src/llmtuner/webui/components/chatbot.py:15
↓ 2 callers
Function
create_preview_box
(dataset_dir: "gr.Textbox", dataset: "gr.Dropdown")
sft/src/llmtuner/webui/components/data.py:57
↓ 2 callers
Function
create_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 callers
Function
create_ui
(demo_mode: Optional[bool] = False)
sft/src/llmtuner/webui/interface.py:22
↓ 2 callers
Function
dispatch_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 callers
Function
dtype_bytes
Return the number of bytes used to store a single instance of `dtype`.
merge/mergekit/io/lazy_unpickle.py:185
↓ 2 callers
Method
encode_multiturn
r""" Returns multiple pairs of token ids representing prompts and responses respectively.
sft/src/llmtuner/data/template.py:53
↓ 2 callers
Function
export_model
(args: Optional[Dict[str, Any]] = None)
sft/src/llmtuner/train/tuner.py:42
↓ 2 callers
Method
extract
(self, content: str)
sft/src/llmtuner/data/formatter.py:80
↓ 2 callers
Method
flush_current_shard
(self)
merge/mergekit/io/tensor_writer.py:64
↓ 2 callers
Method
for_out_slice
(self, slice: OutputSliceDefinition)
merge/mergekit/config.py:134
↓ 2 callers
Method
for_tensor
(self, tensor_name: str)
merge/mergekit/config.py:142
↓ 2 callers
Function
gen_prompt
(que)
evaluate/generate_responses.py:157
↓ 2 callers
Function
get_config_path
()
sft/src/llmtuner/webui/common.py:32
↓ 2 callers
Function
get_infer_args
(args: Optional[Dict[str, Any]] = None)
sft/src/llmtuner/hparams/parser.py:246
↓ 2 callers
Method
get_scores
(self, batch_input: List[str], **input_kwargs)
sft/src/llmtuner/chat/chat_model.py:142
↓ 2 callers
Function
get_time
()
sft/src/llmtuner/webui/utils.py:33
↓ 2 callers
Method
group_label
(self)
merge/mergekit/io/tasks.py:86
↓ 2 callers
Function
is_matplotlib_available
()
sft/src/llmtuner/extras/packages.py:28
↓ 2 callers
Function
list_dataset
( dataset_dir: Optional[str] = None, training_stage: Optional[str] = list(TRAINING_STAGES.keys())[0] )
sft/src/llmtuner/webui/common.py:107
↓ 2 callers
Function
load_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 callers
Function
main
()
sft/src/train_bash.py:4
↓ 2 callers
Function
maybe_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 callers
Function
maybe_torch
(v: np.ndarray, is_torch: bool)
merge/mergekit/merge_methods/slerp.py:154
↓ 2 callers
Function
modelref_md
Generates markdown description for a ModelReference object. Args: model: A ModelReference object. Returns: A markdown f
merge/mergekit/card.py:115
↓ 2 callers
Function
normalize
(v: np.ndarray, eps: float)
merge/mergekit/merge_methods/slerp.py:160
↓ 2 callers
Method
on_train_end
r""" Event called at the end of training.
sft/src/llmtuner/extras/callbacks.py:65
↓ 2 callers
Method
parameter
( self, name: str, model: Optional[ModelReference] = None, default: Any = None
merge/mergekit/config.py:158
↓ 2 callers
Method
parse_example
(self, example: Dict[str, str])
sft/src/llmtuner/eval/template.py:19
↓ 2 callers
Function
parse_kmb
(value: Union[str, int])
merge/mergekit/common.py:215
↓ 2 callers
Method
predict
( self, chatbot: List[Tuple[str, str]], query: str, messages: Sequence[Tuple[s
sft/src/llmtuner/webui/chatter.py:106
↓ 2 callers
Method
priority
Returns the priority of the task for scheduling. Higher numbers indicate higher priority. Default is 0. Returns:
merge/mergekit/graph.py:82
↓ 2 callers
Function
prompt_tup
(e: Expert)
merge/mergekit/scripts/mixtral_moe.py:229
↓ 2 callers
Function
rectify_embed_sizes
(param_name: str, tensors: List[torch.Tensor])
merge/mergekit/common.py:188
↓ 2 callers
Function
register_eval_template
(name: str, system: str, choice: str, answer: str, prefix: str)
sft/src/llmtuner/eval/template.py:42
↓ 2 callers
Function
replace_model
(model: "AutoModelForCausalLMWithValueHead", target: Literal["default", "reward"])
sft/src/llmtuner/train/ppo/utils.py:27
↓ 2 callers
Function
run_exp
(args: Optional[Dict[str, Any]] = None, callbacks: Optional[List["TrainerCallback"]] = None)
sft/src/llmtuner/train/tuner.py:24
↓ 2 callers
Function
slerp
Spherical linear interpolation From: https://gist.github.com/dvschultz/3af50c40df002da3b751efab1daddf2c Args: t (float/np.ndarra
merge/mergekit/merge_methods/slerp.py:94
↓ 2 callers
Function
smooth
r""" EMA implementation according to TensorBoard.
sft/src/llmtuner/extras/ploting.py:19
↓ 2 callers
Method
timing
(self)
sft/src/llmtuner/extras/callbacks.py:45
↓ 2 callers
Function
tokenize_prompts
( prompts: List[str], tokenizer: transformers.PreTrainedTokenizerBase )
merge/mergekit/scripts/mixtral_moe.py:112
↓ 1 callers
Method
__init__
( self, manager: "Manager", demo_mode: Optional[bool] = False, lazy_init: Optional[bool] = True )
sft/src/llmtuner/webui/chatter.py:20
↓ 1 callers
Method
__str__
(self)
merge/mergekit/common.py:64
↓ 1 callers
Function
_configure_attn_implementation
(model_args: "ModelArguments", config_kwargs: Dict[str, Any])
sft/src/llmtuner/model/patcher.py:105
↓ 1 callers
Function
_configure_longlora
(config: "PretrainedConfig")
sft/src/llmtuner/model/patcher.py:144
↓ 1 callers
Function
_configure_quantization
r""" Priority: GPTQ-quantized (training) > AutoGPTQ (export) > Bitsandbytes (training)
sft/src/llmtuner/model/patcher.py:153
↓ 1 callers
Function
_configure_rope
(config: "PretrainedConfig", model_args: "ModelArguments", is_trainable: bool)
sft/src/llmtuner/model/patcher.py:117
↓ 1 callers
Method
_finalize
(self, lang: str, finish_info: str)
sft/src/llmtuner/webui/runner.py:78
↓ 1 callers
Function
_get_donor_tokenizer
( merge_config: MergeConfiguration, trust_remote_code: bool = False )
merge/mergekit/merge.py:127
↓ 1 callers
Function
_get_package_version
(name: str)
sft/src/llmtuner/extras/packages.py:9
↓ 1 callers
Function
_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 callers
Function
_keep_merge
(m)
merge/mergekit/tokenizer.py:92
↓ 1 callers
Function
_load_all_architectures
()
merge/mergekit/architecture.py:294
↓ 1 callers
Function
_model_out_config
Return a configuration for the resulting model.
merge/mergekit/merge.py:148
↓ 1 callers
Function
_normalized_shard_name
(path: str)
merge/mergekit/io/tasks.py:45
↓ 1 callers
Method
_pad_labels
(self, batch: torch.Tensor, positions: List[Tuple[int, int]])
sft/src/llmtuner/train/dpo/collator.py:14
↓ 1 callers
Method
_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 callers
Function
_parse_eval_args
(args: Optional[Dict[str, Any]] = None)
sft/src/llmtuner/hparams/parser.py:96
↓ 1 callers
Function
_parse_infer_args
(args: Optional[Dict[str, Any]] = None)
sft/src/llmtuner/hparams/parser.py:91
↓ 1 callers
Function
_parse_train_args
(args: Optional[Dict[str, Any]] = None)
sft/src/llmtuner/hparams/parser.py:86
↓ 1 callers
Function
_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 callers
Function
_resize_embedding_layer
r""" Resize token embeddings.
sft/src/llmtuner/model/patcher.py:42
↓ 1 callers
Method
_save_results
(self, category_corrects: Dict[str, np.ndarray], results: Dict[str, Dict[int, str]])
sft/src/llmtuner/eval/evaluator.py:103
↓ 1 callers
Method
_save_st
(self, shard_path: str)
merge/mergekit/io/tensor_writer.py:127
↓ 1 callers
Function
_update_config_vocab
( config: transformers.PretrainedConfig, tokenizer: transformers.PreTrainedTokenizerBase, )
merge/mergekit/merge.py:177
↓ 1 callers
Function
align_dataset
r""" Aligned dataset: prompt: [{"role": "user", "content": "..."}] * (2T - 1) response: [{"role": "assistant", "content": "..."}]
sft/src/llmtuner/data/aligner.py:89
↓ 1 callers
Function
annotate_tag
(r)
evaluate/gpt4_as_judge.py:103
↓ 1 callers
Function
apply_llama_patch
()
sft/src/llmtuner/extras/patches/llama_patch.py:195
↓ 1 callers
Method
arguments
(self)
merge/mergekit/io/tasks.py:100
↓ 1 callers
Method
batch_inference
(self, batch_input: Dict[str, torch.Tensor])
sft/src/llmtuner/eval/evaluator.py:34
↓ 1 callers
Function
build
( config: MistralMOEConfig, out_path: str, merge_options: MergeOptions, load_in_4bit: bool = F
merge/mergekit/scripts/mixtral_moe.py:256
↓ 1 callers
Function
build_tokenizer
( base_model: Optional[ModelReference], referenced_models: List[ModelReference], tokenizer_source:
merge/mergekit/tokenizer.py:172
↓ 1 callers
Function
build_union_tokenizer
( base_tok: transformers.PreTrainedTokenizerBase, tokenizers: Dict[ModelReference, transformers.PreTra
merge/mergekit/tokenizer.py:106
↓ 1 callers
Method
chat
( self, messages: Sequence[Dict[str, str]], system: Optional[str] = None, tool
sft/src/llmtuner/chat/chat_model.py:90
↓ 1 callers
Function
chat_completion
(system, prompt)
evaluate/gpt4_as_judge.py:56
↓ 1 callers
Function
chat_completion_claude
(system, prompt)
evaluate/generate_responses.py:112
↓ 1 callers
Function
chat_completion_gpt
(system, prompt)
evaluate/generate_responses.py:88
↓ 1 callers
Function
checksum
(data_files: List[str], file_sha1: Optional[str] = None)
sft/src/llmtuner/data/utils.py:27
↓ 1 callers
Function
clean_thoughts_
(response)
evaluate/gpt4_as_judge.py:40
↓ 1 callers
Function
create_eval_tab
(engine: "Engine")
sft/src/llmtuner/webui/components/eval.py:15
↓ 1 callers
Function
create_export_tab
(engine: "Engine")
sft/src/llmtuner/webui/components/export.py:73
↓ 1 callers
Function
create_infer_tab
(engine: "Engine")
sft/src/llmtuner/webui/components/infer.py:14
↓ 1 callers
Function
create_reward_model
r""" Creates reward model for PPO training.
sft/src/llmtuner/train/utils.py:77
↓ 1 callers
Function
create_top
()
sft/src/llmtuner/webui/components/top.py:15
↓ 1 callers
Function
create_train_tab
(engine: "Engine")
sft/src/llmtuner/webui/components/train.py:18
↓ 1 callers
Function
create_web_demo
()
sft/src/llmtuner/webui/interface.py:57
↓ 1 callers
Function
default_tool_extractor
(content: str)
sft/src/llmtuner/data/formatter.py:56
↓ 1 callers
Function
default_tool_formatter
(tools: List[Dict[str, Any]])
sft/src/llmtuner/data/formatter.py:26
↓ 1 callers
Function
dfs
Returns True if a cycle is detected
merge/mergekit/scripts/megamerge.py:28
↓ 1 callers
Function
dump_layernorm
(model: "PreTrainedModel")
sft/src/llmtuner/train/ppo/utils.py:46
↓ 1 callers
Method
execute
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 callers
Method
execute
Execute all tasks and discard results.
merge/mergekit/graph.py:212
↓ 1 callers
Method
execute
(self)
merge/mergekit/io/tasks.py:68
↓ 1 callers
Function
extract_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 callers
Function
find_all_linear_modules
r""" Finds all available modules to apply lora.
sft/src/llmtuner/model/utils.py:52
↓ 1 callers
Method
flush
(self)
merge/mergekit/io/lazy_tensor_loader.py:141
← previous
next →
101–200 of 581, ranked by callers