Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/chenyiqun/MMOA-RAG
/ functions
Functions
656 in github.com/chenyiqun/MMOA-RAG
⨍
Functions
656
◇
Types & classes
101
↳
Endpoints
5
↓ 1 callers
Function
get_unpad_data
r""" Prepares the indices and seqlens for flash attn varlen function. Returns: indices: indices of non-masked tokens from the flatten
LLaMA-Factory/src/llamafactory/model/model_utils/packing.py:87
↓ 1 callers
Function
get_unsloth_gradient_checkpointing_func
()
LLaMA-Factory/src/llamafactory/model/model_utils/checkpointing.py:41
↓ 1 callers
Function
get_unsloth_peft_model
r""" Gets the peft model for the pretrained model with unsloth. Used in training.
LLaMA-Factory/src/llamafactory/model/model_utils/unsloth.py:66
↓ 1 callers
Function
get_version
()
LLaMA-Factory/setup.py:22
↓ 1 callers
Function
get_vision_feature_select_strategy
r""" Get the vision_feature_select_strategy.
LLaMA-Factory/src/llamafactory/model/model_utils/visual.py:173
↓ 1 callers
Function
get_visual
r""" Judges if the model is a vision language model.
LLaMA-Factory/src/llamafactory/webui/common.py:136
↓ 1 callers
Function
greedy_knapsack
r""" An efficient greedy algorithm with binary search for the knapsack problem.
LLaMA-Factory/src/llamafactory/data/processors/processor_utils.py:27
↓ 1 callers
Function
has_tokenized_data
r""" Checks if the path has a tokenized dataset.
LLaMA-Factory/src/llamafactory/extras/misc.py:171
↓ 1 callers
Function
infer_optim_dtype
r""" Infers the optimal dtype according to the model_dtype and device compatibility.
LLaMA-Factory/src/llamafactory/extras/misc.py:178
↓ 1 callers
Function
init_adapter
r""" Initializes the adapters. Support full-parameter, freeze and LoRA training. Note that the trainable parameters must be cast to floa
LLaMA-Factory/src/llamafactory/model/adapter.py:259
↓ 1 callers
Function
is_galore_available
()
LLaMA-Factory/src/llamafactory/extras/packages.py:49
↓ 1 callers
Function
is_gpu_or_npu_available
r""" Checks if the GPU or NPU is available.
LLaMA-Factory/src/llamafactory/extras/misc.py:190
↓ 1 callers
Function
is_pyav_available
()
LLaMA-Factory/src/llamafactory/extras/packages.py:41
↓ 1 callers
Function
is_rouge_available
()
LLaMA-Factory/src/llamafactory/extras/packages.py:69
↓ 1 callers
Function
is_starlette_available
()
LLaMA-Factory/src/llamafactory/extras/packages.py:73
↓ 1 callers
Function
is_uvicorn_available
()
LLaMA-Factory/src/llamafactory/extras/packages.py:82
↓ 1 callers
Function
is_vllm_available
()
LLaMA-Factory/src/llamafactory/extras/packages.py:86
↓ 1 callers
Function
launch
()
LLaMA-Factory/src/llamafactory/launcher.py:18
↓ 1 callers
Function
llama_attention_forward
( self: "LlamaAttention", hidden_states: "torch.Tensor", attention_mask: Optional["torch.Tensor"]
LLaMA-Factory/src/llamafactory/model/model_utils/longlora.py:52
↓ 1 callers
Function
load_dataset_info
r""" Loads dataset_info.json.
LLaMA-Factory/src/llamafactory/webui/common.py:163
↓ 1 callers
Function
load_mod_pretrained_model
(**init_kwargs)
LLaMA-Factory/src/llamafactory/model/model_utils/mod.py:26
↓ 1 callers
Function
load_unsloth_peft_model
r""" Loads peft model with unsloth. Used in both training and inference.
LLaMA-Factory/src/llamafactory/model/model_utils/unsloth.py:82
↓ 1 callers
Function
load_unsloth_pretrained_model
r""" Optionally loads pretrained model with unsloth. Used in training.
LLaMA-Factory/src/llamafactory/model/model_utils/unsloth.py:47
↓ 1 callers
Function
lower
Converts all characters in the text to lowercase.
normalize_answers.py:27
↓ 1 callers
Function
lower
Converts all characters in the text to lowercase.
LLaMA-Factory/src/llamafactory/train/ppo/normalize_answers.py:27
↓ 1 callers
Function
main
()
LLaMA-Factory/setup.py:67
↓ 1 callers
Function
main
()
LLaMA-Factory/src/train.py:18
↓ 1 callers
Function
main
()
LLaMA-Factory/src/api.py:23
↓ 1 callers
Function
main
()
LLaMA-Factory/src/webui.py:20
↓ 1 callers
Function
main
()
LLaMA-Factory/scripts/test_toolcall.py:36
↓ 1 callers
Function
merge_dataset
r""" Merges multiple datasets to a unified dataset.
LLaMA-Factory/src/llamafactory/data/data_utils.py:49
↓ 1 callers
Method
monitor
(self)
LLaMA-Factory/src/llamafactory/webui/runner.py:341
↓ 1 callers
Function
normalize
(text)
LLaMA-Factory/src/llamafactory/train/ppo/normalize_text.py:105
↓ 1 callers
Method
odds_ratio_loss
r""" Computes ORPO's odds ratio (OR) loss for batched log probabilities of the policy model.
LLaMA-Factory/src/llamafactory/train/dpo/trainer.py:121
↓ 1 callers
Method
on_log
(self, args: "TrainingArguments", state: "TrainerState", control: "TrainerControl", **kwargs)
LLaMA-Factory/src/llamafactory/train/callbacks.py:283
↓ 1 callers
Method
on_save
(self, args: "TrainingArguments", state: "TrainerState", control: "TrainerControl", **kwargs)
LLaMA-Factory/src/llamafactory/train/callbacks.py:124
↓ 1 callers
Method
on_step_end
(self, args: "TrainingArguments", state: "TrainerState", control: "TrainerControl", **kwargs)
LLaMA-Factory/src/llamafactory/train/callbacks.py:267
↓ 1 callers
Method
on_train_begin
(self, args: "TrainingArguments", state: "TrainerState", control: "TrainerControl", **kwargs)
LLaMA-Factory/src/llamafactory/train/callbacks.py:250
↓ 1 callers
Method
on_train_end
(self, args: "TrainingArguments", state: "TrainerState", control: "TrainerControl", **kwargs)
LLaMA-Factory/src/llamafactory/train/callbacks.py:257
↓ 1 callers
Function
patch_config
( config: "PretrainedConfig", tokenizer: "PreTrainedTokenizer", model_args: "ModelArguments",
LLaMA-Factory/src/llamafactory/model/patcher.py:77
↓ 1 callers
Function
patch_model
( model: "PreTrainedModel", tokenizer: "PreTrainedTokenizer", model_args: "ModelArguments", is
LLaMA-Factory/src/llamafactory/model/patcher.py:132
↓ 1 callers
Function
patch_processor
( processor: "ProcessorMixin", config: "PretrainedConfig", tokenizer: "PreTrainedTokenizer", m
LLaMA-Factory/src/llamafactory/model/patcher.py:61
↓ 1 callers
Function
patch_target_modules
r""" Freezes vision tower for VLM LoRA tuning.
LLaMA-Factory/src/llamafactory/model/model_utils/visual.py:181
↓ 1 callers
Function
patch_tokenizer
(tokenizer: "PreTrainedTokenizer")
LLaMA-Factory/src/llamafactory/model/patcher.py:56
↓ 1 callers
Function
patch_valuehead_model
(model: "AutoModelForCausalLMWithValueHead")
LLaMA-Factory/src/llamafactory/model/patcher.py:170
↓ 1 callers
Method
ppo_train
r""" Implements training loop for the PPO stage, like _inner_training_loop() in Huggingface's Trainer.
LLaMA-Factory/src/llamafactory/train/ppo/trainer_qr_s_g.py:673
↓ 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
LLaMA-Factory/src/llamafactory/model/model_utils/checkpointing.py:139
↓ 1 callers
Function
prepare_valuehead_model
(model: "PreTrainedModel")
LLaMA-Factory/src/llamafactory/model/model_utils/valuehead.py:62
↓ 1 callers
Function
print_attn_implementation
(config: "PretrainedConfig")
LLaMA-Factory/src/llamafactory/model/model_utils/attention.py:76
↓ 1 callers
Function
print_env
()
LLaMA-Factory/src/llamafactory/extras/env.py:32
↓ 1 callers
Function
register_autoclass
(config: "PretrainedConfig", model: "PreTrainedModel", tokenizer: "PreTrainedTokenizer")
LLaMA-Factory/src/llamafactory/model/model_utils/misc.py:87
↓ 1 callers
Function
remove_articles
Removes articles ('a', 'an', 'the') from the text.
normalize_answers.py:7
↓ 1 callers
Function
remove_articles
Removes articles ('a', 'an', 'the') from the text.
LLaMA-Factory/src/llamafactory/train/ppo/normalize_answers.py:7
↓ 1 callers
Function
resize_embedding_layer
r""" Resize token embeddings.
LLaMA-Factory/src/llamafactory/model/model_utils/embedding.py:40
↓ 1 callers
Function
restore_layernorm
r""" Restores the layernorm parameters in the model. The model is already unwrapped (and gathered).
LLaMA-Factory/src/llamafactory/train/ppo/ppo_utils.py:82
↓ 1 callers
Function
run_api
()
LLaMA-Factory/src/llamafactory/api/app.py:128
↓ 1 callers
Function
run_chat
()
LLaMA-Factory/src/llamafactory/chat/chat_model.py:150
↓ 1 callers
Function
run_dpo
( model_args: "ModelArguments", data_args: "DataArguments", training_args: "Seq2SeqTrainingArgumen
LLaMA-Factory/src/llamafactory/train/dpo/workflow.py:35
↓ 1 callers
Function
run_eval
()
LLaMA-Factory/src/llamafactory/eval/evaluator.py:157
↓ 1 callers
Function
run_kto
( model_args: "ModelArguments", data_args: "DataArguments", training_args: "Seq2SeqTrainingArgumen
LLaMA-Factory/src/llamafactory/train/kto/workflow.py:35
↓ 1 callers
Function
run_ppo
( model_args: "ModelArguments", data_args: "DataArguments", training_args: "Seq2SeqTrainingArgumen
LLaMA-Factory/src/llamafactory/train/ppo/workflow.py:34
↓ 1 callers
Function
run_pt
( model_args: "ModelArguments", data_args: "DataArguments", training_args: "Seq2SeqTrainingArgumen
LLaMA-Factory/src/llamafactory/train/pt/workflow.py:36
↓ 1 callers
Function
run_rm
( model_args: "ModelArguments", data_args: "DataArguments", training_args: "Seq2SeqTrainingArgumen
LLaMA-Factory/src/llamafactory/train/rm/workflow.py:35
↓ 1 callers
Function
run_sft
( model_args: "ModelArguments", data_args: "DataArguments", training_args: "Seq2SeqTrainingArgumen
LLaMA-Factory/src/llamafactory/train/sft/workflow.py:36
↓ 1 callers
Function
run_web_demo
()
LLaMA-Factory/src/llamafactory/webui/interface.py:93
↓ 1 callers
Function
run_web_ui
()
LLaMA-Factory/src/llamafactory/webui/interface.py:87
↓ 1 callers
Function
save_cmd
r""" Saves arguments to launch training.
LLaMA-Factory/src/llamafactory/webui/utils.py:125
↓ 1 callers
Function
save_config
(input_dir: str, output_dir: str)
LLaMA-Factory/scripts/llamafy_baichuan2.py:74
↓ 1 callers
Function
save_config
(input_dir: str, output_dir: str, torch_dtype: str)
LLaMA-Factory/scripts/llamafy_qwen.py:111
↓ 1 callers
Method
save_predictions
r""" Saves model predictions to `output_dir`. A custom behavior that not contained in Seq2SeqTrainer.
LLaMA-Factory/src/llamafactory/train/rm/trainer.py:106
↓ 1 callers
Method
save_predictions
r""" Saves model predictions to `output_dir`. A custom behavior that not contained in Seq2SeqTrainer.
LLaMA-Factory/src/llamafactory/train/sft/trainer.py:122
↓ 1 callers
Function
save_weight
(input_dir: str, output_dir: str, shard_size: str, save_safetensors: bool)
LLaMA-Factory/scripts/llamafy_baichuan2.py:37
↓ 1 callers
Function
save_weight
(input_dir: str, output_dir: str, shard_size: str, save_safetensors: bool)
LLaMA-Factory/scripts/llamafy_qwen.py:45
↓ 1 callers
Function
search_for_fit
r""" Finds the index of largest number that fits into the knapsack with the given capacity.
LLaMA-Factory/src/llamafactory/data/processors/processor_utils.py:19
↓ 1 callers
Method
simpo_loss
r""" Computes SimPO loss for batched log probabilities of the policy model.
LLaMA-Factory/src/llamafactory/train/dpo/trainer.py:133
↓ 1 callers
Function
skip_check_imports
r""" Avoids flash attention import error in custom model files.
LLaMA-Factory/src/llamafactory/extras/misc.py:211
↓ 1 callers
Function
split_dataset
r""" Splits the dataset and returns a dataset dict containing train set and validation set. Supports both map dataset and iterable dataset.
LLaMA-Factory/src/llamafactory/data/data_utils.py:76
↓ 1 callers
Function
sweeper
()
LLaMA-Factory/src/llamafactory/api/app.py:55
↓ 1 callers
Method
tool_extractor
r""" Extracts all the function calls from the response message.
LLaMA-Factory/src/llamafactory/data/tool_utils.py:71
↓ 1 callers
Method
tool_formatter
r""" Generates the system message describing all the available tools.
LLaMA-Factory/src/llamafactory/data/tool_utils.py:63
↓ 1 callers
Function
try_download_model_from_ms
(model_args: "ModelArguments")
LLaMA-Factory/src/llamafactory/extras/misc.py:234
↓ 1 callers
Method
zero_grad
(self, set_to_none: bool = True)
LLaMA-Factory/src/llamafactory/train/trainer_utils.py:65
Method
__call__
(self, features: Sequence[Dict[str, Any]])
LLaMA-Factory/src/llamafactory/data/collator.py:81
Method
__call__
(self, features: Sequence[Dict[str, Any]])
LLaMA-Factory/src/llamafactory/data/collator.py:115
Method
__call__
r""" Pads batched data to the longest sequence in the batch. We generate 2 * n examples where the first n examples represent chosen e
LLaMA-Factory/src/llamafactory/data/collator.py:129
Method
__call__
(self, eval_preds: "EvalPrediction", compute_result: bool = True)
LLaMA-Factory/src/llamafactory/train/rm/metric.py:44
Method
__call__
(self, eval_preds: "EvalPrediction", compute_result: bool = True)
LLaMA-Factory/src/llamafactory/train/sft/metric.py:80
Method
__call__
(self, eval_preds: "EvalPrediction", compute_result: bool = True)
LLaMA-Factory/src/llamafactory/train/sft/metric.py:112
Method
__call__
(self, input_ids, scores)
LLaMA-Factory/src/llamafactory/train/ppo/trainer_qr_s_g.py:190
Method
__call__
r""" Pads batched data to the longest sequence in the batch. We generate 2 * n examples where the first n examples represent chosen e
LLaMA-Factory/scripts/cal_ppl.py:40
Function
__init__
(self, data, **kwargs)
LLaMA-Factory/src/llamafactory/data/preprocess.py:56
Method
__init__
(self, vision_hidden_size: int, text_hidden_size: int, projector_hidden_act: str)
LLaMA-Factory/src/llamafactory/model/model_utils/visual.py:73
Method
__init__
( self, model_args: "ModelArguments", data_args: "DataArguments", finetuning_a
LLaMA-Factory/src/llamafactory/chat/vllm_engine.py:50
Method
__init__
r""" Initializes an inference engine.
LLaMA-Factory/src/llamafactory/chat/base_engine.py:51
Method
__init__
(self, args: Optional[Dict[str, Any]] = None)
LLaMA-Factory/src/llamafactory/chat/chat_model.py:48
Method
__init__
( self, model_args: "ModelArguments", data_args: "DataArguments", finetuning_a
LLaMA-Factory/src/llamafactory/chat/hf_engine.py:46
Method
__init__
(self, args: Optional[Dict[str, Any]] = None)
LLaMA-Factory/src/llamafactory/eval/evaluator.py:62
Method
__init__
(self, output_dir: str)
LLaMA-Factory/src/llamafactory/extras/logging.py:38
Method
__init__
(self)
LLaMA-Factory/src/llamafactory/extras/misc.py:59
Method
__init__
( self, lr: float = 1e-3, optimizer_dict: Optional[Dict["torch.nn.Parameter", "torch.optim.Optimizer"]
LLaMA-Factory/src/llamafactory/train/trainer_utils.py:57
← previous
next →
301–400 of 656, ranked by callers