MCPcopy Create free account

hub / github.com/RUC-NLPIR/SmartSearch / functions

Functions2,379 in github.com/RUC-NLPIR/SmartSearch

Methodbuild_memory_reference
(self)
src/verl/utils/memory_buffer.py:202
Functioncache_manager
Decorator used for retrieving document cache. With the decorator, The retriever can store each retrieved document as a file and reuse it.
src/flashrag/retriever/retriever.py:20
Methodcal_gen_probs
(self, prev, next)
src/flashrag/generator/generator.py:580
Functioncalc_maj_val
Calculate the majority voting metric
src/verl/trainer/ppo/metric_utils.py:189
Functioncalculate_flops
r"""Calculate the flops of pre-trained models. Usage: python cal_flops.py --model_name_or_path path_to_model --batch_size 1 --seq_length 512
LLaMA-Factory/scripts/stat_utils/cal_flops.py:26
Functioncalculate_gpa
(grades: list[str], hours: list[int])
LLaMA-Factory/scripts/api_example/test_toolcall.py:25
Functioncalculate_lr
r"""Calculate the optimal learning rate for 7B/13B models using LLaMA's hyper-parameters. Usage: python cal_lr.py --model_name_or_path path_t
LLaMA-Factory/scripts/stat_utils/cal_lr.py:37
Methodcalculate_metric
Get the total score of this metric and score for each sample. Args: data object: it contains basic information and generated i
src/flashrag/evaluator/metrics.py:21
Methodcalculate_metric
(self, data)
src/flashrag/evaluator/metrics.py:90
Methodcalculate_metric
(self, data)
src/flashrag/evaluator/metrics.py:110
Methodcalculate_metric
(self, data)
src/flashrag/evaluator/metrics.py:129
Methodcalculate_metric
(self, data)
src/flashrag/evaluator/metrics.py:172
Methodcalculate_metric
(self, data)
src/flashrag/evaluator/metrics.py:213
Methodcalculate_metric
(self, data)
src/flashrag/evaluator/metrics.py:234
Methodcalculate_metric
(self, data)
src/flashrag/evaluator/metrics.py:266
Methodcalculate_metric
(self, data)
src/flashrag/evaluator/metrics.py:324
Methodcalculate_metric
(self, data)
src/flashrag/evaluator/metrics.py:343
Methodcalculate_metric
(self, data)
src/flashrag/evaluator/metrics.py:362
Methodcalculate_metric
(self, data)
src/flashrag/evaluator/metrics.py:415
Methodcalculate_metric
(self, data)
src/flashrag/evaluator/metrics.py:434
Methodcalculate_metric
(self, data)
src/flashrag/evaluator/metrics.py:453
Methodcalculate_metric
(self, data)
src/flashrag/evaluator/metrics.py:564
Methodcalculate_metric
(self, data)
src/flashrag/evaluator/metrics.py:606
Methodcalculate_metric
(self, data)
src/flashrag/evaluator/metrics.py:621
Functioncalculate_mfu
r"""Calculate MFU for given model and hyper-params. Usage: python cal_mfu.py --model_name_or_path path_to_model --batch_size 1 --seq_length 1024
LLaMA-Factory/scripts/stat_utils/cal_mfu.py:101
Functioncalculate_ppl
r"""Calculate the ppl on the dataset of the pre-trained models. Usage: export CUDA_VISIBLE_DEVICES=0 python cal_ppl.py --model_name_or_path p
LLaMA-Factory/scripts/stat_utils/cal_ppl.py:55
Methodcalculate_rouge
(self, pred, golden_answers)
src/flashrag/evaluator/metrics.py:386
Functioncan_preview
r"""Check if the dataset is a local dataset.
LLaMA-Factory/src/llamafactory/webui/components/data.py:42
Functioncan_quantize
r"""Judge if the quantization is available in this finetuning type. Inputs: top.finetuning_type Outputs: top.quantization_bit
LLaMA-Factory/src/llamafactory/webui/control.py:50
Functioncan_quantize
(checkpoint_path: str | list[str])
LLaMA-Factory/src/llamafactory/webui/components/export.py:40
Functioncan_quantize_to
r"""Get the available quantization bits. Inputs: top.quantization_method Outputs: top.quantization_bit
LLaMA-Factory/src/llamafactory/webui/control.py:62
Methodchange_lang
r"""Update the displayed language of gradio components.
LLaMA-Factory/src/llamafactory/webui/engine.py:77
Functionchange_stage
r"""Modify states after changing the training stage. Inputs: train.training_stage Outputs: train.dataset, train.packing
LLaMA-Factory/src/llamafactory/webui/control.py:78
Methodchat
( self, messages: list[dict[str, str]], system: Optional[str] = None, tools: O
LLaMA-Factory/src/llamafactory/chat/vllm_engine.py:219
Methodchat
r"""Get a list of responses of the chat model.
LLaMA-Factory/src/llamafactory/chat/base_engine.py:64
Methodchat
( self, messages: Sequence[dict[str, str]], system: Optional[str] = None, tool
LLaMA-Factory/src/llamafactory/chat/sglang_engine.py:232
Methodchat
( self, messages: list[dict[str, str]], system: Optional[str] = None, tools: O
LLaMA-Factory/src/llamafactory/chat/kt_engine.py:220
Methodchat
( self, messages: list[dict[str, str]], system: Optional[str] = None, tools: O
LLaMA-Factory/src/llamafactory/chat/hf_engine.py:335
Functioncheck_correctness
Check correctness of code generation with a global timeout. The global timeout is to catch some extreme/rare cases not handled by the timeouts
src/verl/utils/reward_score/prime_code/utils.py:40
Functioncheck_json_schema
r"""Check if the json schema is valid.
LLaMA-Factory/src/llamafactory/webui/components/chatbot.py:34
Methodcheck_mutually_exclusive
(mbs, mbs_per_gpu, name: str)
src/verl/trainer/ppo/ray_trainer.py:309
Methodcheck_output_dir
r"""Restore the training status if output_dir exists.
LLaMA-Factory/src/llamafactory/webui/runner.py:492
Functioncheck_template
r"""Check if an instruct model is used. Please use queue=True to show the warning message. Inputs: top.lang, top.template
LLaMA-Factory/src/llamafactory/webui/control.py:96
Functioncheck_workers_alive
(workers: List, is_alive: Callable, gap_time: float = 1)
src/verl/single_controller/base/worker_group.py:82
Methodcheckpath
(local_path: str, hdfs_path: str)
src/verl/utils/checkpoint/checkpoint_manager.py:71
Methodchunk
(self, chunks: int)
src/verl/protocol.py:735
Functionclear_accelerator_cache
()
LLaMA-Factory/tests_v1/plugins/model_plugins/test_kernel_plugin.py:28
Functionclip_by_value
Tensor extenstion to torch.clamp https://github.com/pytorch/pytorch/issues/2793#issuecomment-428784713
src/verl/utils/torch_functional.py:97
Functioncollate_fn
(x: list['DataProtoItem'])
src/verl/protocol.py:152
Functioncollate_fn
(data_list: list[dict])
src/verl/utils/dataset/rl_dataset.py:32
Functioncollect_all_to_all
(worker_group, output)
src/verl/single_controller/base/decorator.py:70
Functioncollect_dp_compute_data_proto
(worker_group, output)
src/verl/single_controller/base/decorator.py:294
Functioncollect_megatron_compute_data_proto
Each output must be a DataProto. We concat the dim=0 of output
src/verl/single_controller/base/decorator.py:147
Functioncollect_megatron_pp_as_dp_data_proto
(worker_group, output)
src/verl/single_controller/base/decorator.py:251
Functioncollect_megatron_pp_only
Only collect output of megatron pp. This is useful when examine weight names as they are identical in tp/dp
src/verl/single_controller/base/decorator.py:227
Methodcompress_json
( self, json_data: dict, json_config: Union[str, dict], instruction: str =
src/flashrag/refiner/llmlingua_compressor.py:353
Functioncompute_entropy_loss
Compute Categorical entropy loss Args: logits: `(torch.Tensor)` shape: (bs, response_length, vocab_size) respons
src/verl/trainer/ppo/core_algos.py:405
Functioncompute_gae_advantage_return
Adapted from https://github.com/huggingface/trl/blob/main/trl/trainer/ppo_trainer.py Args: token_level_rewards: `(torch.Tensor)`
src/verl/trainer/ppo/core_algos.py:66
Functioncompute_grad_norm
(model: nn.Module)
src/verl/utils/torch_functional.py:173
Functioncompute_grpo_outcome_advantage
Compute advantage for GRPO, operating only on Outcome reward (with only one scalar reward for each response). Args: token_le
src/verl/trainer/ppo/core_algos.py:107
Methodcompute_log_prob
Compute the log probability of the responses given input_ids, attention_mask and position_ids Args: data (DataProto): a DataPr
src/verl/workers/actor/megatron_actor.py:148
Methodcompute_log_prob
Compute the log probability of the responses given input_ids, attention_mask and position_ids Args: data (DataProto): a DataPr
src/verl/workers/actor/dp_actor.py:177
Methodcompute_logprobs_fn
(output, data)
src/verl/workers/actor/megatron_actor.py:168
Methodcompute_loss
r"""Compute pairwise loss. The first n examples are chosen and the last n examples are rejected. Subclass and override to inject custom behav
LLaMA-Factory/src/llamafactory/train/rm/trainer.py:88
Methodcompute_loss
(self, model, inputs, *args, **kwargs)
LLaMA-Factory/src/llamafactory/train/sft/trainer.py:116
Methodcompute_loss
(self, model, inputs, *args, **kwargs)
LLaMA-Factory/src/llamafactory/train/pt/trainer.py:92
Methodcompute_loss
r"""Subclass and override to accept extra kwargs.
LLaMA-Factory/src/llamafactory/train/kto/trainer.py:256
Methodcompute_loss
r"""Subclass and override to accept extra kwargs.
LLaMA-Factory/src/llamafactory/train/dpo/trainer.py:305
Functioncompute_metrics
(sample)
LLaMA-Factory/scripts/eval_bleu_rouge.py:35
Methodcompute_ref_log_prob
(self, data: DataProto)
src/verl/workers/megatron_workers.py:436
Functioncompute_reinforce_plus_plus_baseline_outcome_advantage
Compute advantage for RF++-baseline (https://arxiv.org/abs/2501.03262), operating only on Outcome reward (with only one scalar reward for
src/verl/trainer/ppo/core_algos.py:152
Functioncompute_reinforce_plus_plus_outcome_advantage
Compute advantage for REINFORCE++. This implementation is based on the paper: https://arxiv.org/abs/2501.03262 Args: token_l
src/verl/trainer/ppo/core_algos.py:241
Functioncompute_remax_outcome_advantage
Compute advantage for ReMax, operating only on Outcome reward This implementation is based on the paper: https://arxiv.org/abs/2310.10505
src/verl/trainer/ppo/core_algos.py:275
Methodcompute_reward
(self, data: DataProto)
src/verl/workers/reward_model/megatron/reward_model.py:118
Functioncompute_rewards
(token_level_scores, old_log_prob, ref_log_prob, kl_ratio)
src/verl/trainer/ppo/core_algos.py:304
Functioncompute_rloo_outcome_advantage
Compute advantage for RLOO based on https://arxiv.org/abs/2402.14740 Args: token_level_rewards: `(torch.Tensor)` shap
src/verl/trainer/ppo/core_algos.py:197
Methodcompute_rm_score
(self, data: DataProto)
src/verl/workers/megatron_workers.py:833
Functioncompute_score
(predict_str: str, ground_truth: str)
src/verl/utils/reward_score/geo3k.py:30
Functioncompute_score
The scoring function for GSM8k. Reference: Trung, Luong, et al. "Reft: Reasoning with reinforced fine-tuning." Proceedings of the 62nd Annual M
src/verl/utils/reward_score/gsm8k.py:44
Functioncompute_score
(model_output: str, ground_truth: str, timeout_score: float = 0)
src/verl/utils/reward_score/math_verify.py:23
Functioncompute_score
Compute the reward score for a solution. Args: solution_str: The solution string ground_truth: The ground truth answer
src/verl/utils/reward_score/math_dapo.py:262
Functioncompute_score
(completion, test_cases, continuous=False)
src/verl/utils/reward_score/prime_code/__init__.py:21
Functioncompute_score
(model_output: str, ground_truth: str)
src/verl/utils/reward_score/prime_math/__init__.py:408
Functioncompute_score_batched
This is a demonstration of how the batched reward function should look like. Typically, you want to use batched reward to speed up the proc
src/verl/utils/reward_score/math_batch.py:18
Functioncompute_score_with_format
(tokenizer, solution_str, ground_truth)
src/verl/utils/reward_score/re_call.py:215
Functioncompute_value_loss
Compute the value loss. Copied from https://github.com/huggingface/trl/blob/main/trl/trainer/ppo_trainer.py#L1151 Args: vpreds (`torch
src/verl/trainer/ppo/core_algos.py:424
Methodcompute_values
(self, data: DataProto)
src/verl/workers/megatron_workers.py:656
Methodcompute_values
Compute values
src/verl/workers/critic/base.py:33
Methodcompute_values
(self, data: DataProto)
src/verl/workers/critic/megatron_critic.py:79
Methodcompute_values
(self, data: DataProto)
src/verl/workers/critic/dp_critic.py:131
Methodconcat
(data: List[ray.ObjectRef])
src/verl/protocol.py:731
Methodconcatenated_forward
r"""Compute the sum log probabilities of the labels under given logits if loss_type is not IPO, ORPO or SimPO. Otherwise the average log prob
LLaMA-Factory/src/llamafactory/train/dpo/ktrainer.py:34
Methodconfig
(self)
src/flashrag/generator/openai_generator.py:42
Methodconfig
(self)
src/flashrag/generator/generator.py:27
Methodconfig
(self)
src/flashrag/retriever/retriever.py:123
Functionconvert
Convert checkpoint between MCA and HuggingFace formats. Args: checkpoint_path: Path to the checkpoint to convert output_path: Pat
LLaMA-Factory/scripts/megatron_merge.py:64
Methodcos_sim
(a, b)
src/flashrag/refiner/llmlingua_compressor.py:1947
Functioncount_consecutive
(tensor)
src/verl/workers/rollout/vllm_rollout/generate_new_prompts.py:157
Methodcount_correct_process
(self, entry)
scripts/data_construction/transfer_dpo.py:7
Methodcount_wrong_process
(self, entry)
scripts/data_construction/transfer_dpo.py:18
← previousnext →1,701–1,800 of 2,379, ranked by callers