MCPcopy Create free account

hub / github.com/InternScience/SciReason / functions

Functions3,711 in github.com/InternScience/SciReason

↓ 6 callersMethodgenerate_label_prompt_item
Generate prompt based on :obj:`entry` data, :obj:`ice` in-context example, and the corresponding :obj:`label`. Args: ent
opencompass/openicl/icl_prompt_template.py:105
↓ 6 callersMethodget_log_path
Get the path to the log file. Args: file_extension (str): The file extension of the log file. Default: 'json'.
opencompass/tasks/base.py:92
↓ 6 callersMethodinference
(self, retriever: BaseRetriever, ice_template: Optional[PromptTemplate] =
opencompass/openicl/icl_inferencer/icl_ll_inferencer.py:58
↓ 6 callersMethodload_single
(path, data_filename, label_filename)
opencompass/datasets/piqa.py:17
↓ 6 callersMethodload_single
(path, data_filename, label_filename)
opencompass/datasets/siqa.py:18
↓ 6 callersMethodparse_template
Parse a prompt template, and wrap it with meta template if applicable. Args: prompt_template (List[PromptType]): A prompt
opencompass/models/base.py:300
↓ 6 callersMethodreadlines
(self, *args, **kwargs)
opencompass/datasets/livecodebench/execute_utils.py:165
↓ 6 callersFunctionstring_to_tree
This function converts ids string to a string that can be used as a tree input to APTED. Any Error raised by this function implies that the i
opencompass/datasets/lawbench/utils/char_smi.py:340
↓ 6 callersFunctiontruncatefn
(s, length=300)
opencompass/datasets/livecodebench/testing_util.py:22
↓ 5 callersMethod_calculate_group_metrics
The function calculates the numerical results for each group based on the configuration in summary_groups, and updates the contents of
opencompass/summarizers/default.py:137
↓ 5 callersFunction_check_type_list
(obj, typelist: List)
opencompass/utils/types.py:22
↓ 5 callersFunction_get_possible_max_seq_len
(max_seq_len, path)
opencompass/models/huggingface_above_v4_33.py:45
↓ 5 callersMethod_pick_up_results
The function reads the numerical results of evaluations from the output folder based on the configuration file, and ultimately returns
opencompass/summarizers/default.py:67
↓ 5 callersFunctioncalc_scores_f1
(dict_gt, dict_pred)
opencompass/datasets/medbench/medbench.py:417
↓ 5 callersMethoddevice
(self)
opencompass/datasets/unconditional_protein_generation/omegafold/modules.py:185
↓ 5 callersFunctionestimator
Calculates 1 - comb(n - c, k) / comb(n, k).
opencompass/datasets/livecodebench/pass_k_utils.py:9
↓ 5 callersMethodexec_code
(self, code_piece: str)
opencompass/lagent/actions/python_interpreter.py:26
↓ 5 callersMethodformat
Generate the ReAct format prompt. Args: chat_history (List[Dict]): The history log in previous runs. inner_step (List
opencompass/lagent/agents/react.py:19
↓ 5 callersFunctionget_number
(options)
opencompass/datasets/kaoshi.py:12
↓ 5 callersFunctionload
(f, *args, **kwargs)
opencompass/utils/fileio.py:258
↓ 5 callersMethodload
(path)
opencompass/datasets/hellaswag.py:17
↓ 5 callersFunctionmulti_choice_judge
(prediction, option_list, answer_token)
opencompass/datasets/lawbench/utils/function_utils.py:11
↓ 5 callersFunctionpost_process
(dataset_name, setting_name, prediction)
opencompass/datasets/agieval/post_process.py:180
↓ 5 callersFunctionremoveprefix
(s, prefix)
opencompass/datasets/PMMEval/mifeval_utils/detectable_format_checker.py:5
↓ 5 callersFunctionsafe_format
Safely formats a string with the given keyword arguments. If a keyword is not found in the string, it will be ignored. Args: input_st
opencompass/utils/prompt.py:11
↓ 5 callersMethodsave_results
(self, origin_prompt, prediction, idx, gold=None)
opencompass/openicl/icl_inferencer/icl_base_inferencer.py:114
↓ 5 callersMethodsummarize
Summarize the results of the tasks. Args: status (list[tuple[str, int]]): A list of (task name, exit code).
opencompass/runners/base.py:54
↓ 5 callersFunctionvisualize
(df_raw, save_path: str,model_name: str ,dataset_type:str)
opencompass/summarizers/needlebench.py:256
↓ 4 callersFunctionPEER_postprocess
从模型的原始输出中提取预测结果(Yes或No)。 此函数会查找并返回跟在The answer is后面的Yes或者No, 或从文本中识别常见的Yes/No表达方式。
opencompass/datasets/PEER/evaluator.py:67
↓ 4 callersMethod__init__
(self)
opencompass/datasets/smolinstruct.py:353
↓ 4 callersMethod__init__
(self, label, children=None, node_type='other')
opencompass/datasets/phybench/EED.py:206
↓ 4 callersFunction_convert_base_messages
(inputs)
opencompass/models/huggingface_above_v4_33.py:496
↓ 4 callersMethod_encode_template
Encode the raw template given in the config into a str or a PromptList. Args: prompt_template (List[Dict]] or str): The r
opencompass/openicl/icl_prompt_template.py:209
↓ 4 callersFunction_get_sharded_stacked
( edge_repr: torch.Tensor, subbatch_size: int )
opencompass/datasets/unconditional_protein_generation/omegafold/modules.py:551
↓ 4 callersMethod_get_sliced_weight
(self, weight: torch.Tensor, shift=0)
opencompass/datasets/unconditional_protein_generation/omegafold/modules.py:671
↓ 4 callersFunction_make_rigid_transformation_4x4
Create a rigid 4x4 transformation matrix from two axes and transl.
opencompass/datasets/unconditional_protein_generation/omegafold/utils/protein_utils/residue_constants.py:470
↓ 4 callersMethodbuild_description
(self)
opencompass/datasets/IFEval/instructions.py:899
↓ 4 callersFunctionbuild_from_cfg
A helper function that builds object with MMEngine's new config.
opencompass/registry.py:49
↓ 4 callersFunctioncalculate_elementwise_average
(model_name, merged_df)
opencompass/summarizers/needlebench.py:98
↓ 4 callersFunctioncalculate_metrics
(output, target)
opencompass/datasets/opi/utils/metrics4all.py:10
↓ 4 callersFunctioncomputeFScore
(tp, fp, fn, beta)
opencompass/datasets/lawbench/utils/compare_m2_for_evaluation.py:356
↓ 4 callersFunctioncompute_R2
(label_values, result_values)
opencompass/datasets/bioinstruction/evaluator.py:430
↓ 4 callersFunctioncompute_R2
(label_values, result_values)
opencompass/datasets/bio_instruction/bio_instrcution.py:318
↓ 4 callersFunctioncompute_rouge
(hyps, refs)
opencompass/datasets/lawbench/utils/function_utils.py:32
↓ 4 callersFunctionconvert_by_vocab
Converts a sequence of [tokens|ids] using the vocab.
opencompass/datasets/lawbench/utils/modules/tokenization.py:84
↓ 4 callersFunctionextract_last_line
(string)
opencompass/datasets/agieval/post_process.py:8
↓ 4 callersFunctionextract_numeric_values
(text)
opencompass/datasets/bioinstruction/evaluator.py:143
↓ 4 callersFunctionextract_numeric_values
(text)
opencompass/datasets/bio_instruction/bio_instrcution.py:102
↓ 4 callersFunctionextract_role_pred
Extract the role prediction from the full prediction string. The role prediction may be the substring between the begin and end string. Args:
opencompass/tasks/base.py:12
↓ 4 callersFunctionfloatify
(num: str)
opencompass/datasets/TheoremQA/number_utils.py:7
↓ 4 callersFunctionformat_load
Format the raw data into the format that can be evaluated. Args: raw_data (str): The raw data. start_character (str, optional): T
opencompass/datasets/teval/utils/format_load.py:3
↓ 4 callersMethodgenerate
Generate results given a list of inputs. Args: inputs (List[str]): A list of strings. max_out_len (int): The maximum
opencompass/models/vllm.py:64
↓ 4 callersMethodgenerate_ice_item
Generate in-context example based on the provided :obj:`entry` data. Args: entry (:obj:`Dict`): A piece of data to be used for ge
opencompass/openicl/icl_prompt_template.py:71
↓ 4 callersMethodgenerate_input_field_corpus
Generate corpus for input field. Args: dataset (:obj:`Dataset` or :obj:`DatasetDict`): A :obj:`datasets.Dataset`
opencompass/openicl/icl_dataset_reader.py:117
↓ 4 callersFunctionget_definition_name
(node: Node)
opencompass/datasets/bigcodebench/extractor.py:81
↓ 4 callersMethodget_labels
Get the labels of the dataset, especially useful for ppl inferencer. If `ice_template` is provided, the labels will be the keys of the
opencompass/openicl/icl_retriever/icl_base_retriever.py:47
↓ 4 callersFunctionget_molecule_id
(smiles, remove_duplicate=True)
opencompass/datasets/LLM4Chem/utils/smiles_canonicalization.py:130
↓ 4 callersMethodget_output_paths
Get the paths to the output files. Every file should exist if the task succeeds. Args: file_extension (str): The file ext
opencompass/tasks/base.py:103
↓ 4 callersMethodget_ppl
Get perplexity scores given a list of inputs. Args: inputs (List[str]): A list of strings. mask_length (Optional[List
opencompass/models/turbomind.py:158
↓ 4 callersMethodget_ppl_from_template
Get perplexity given a list of templates. Args: templates (List[PromptType]): A list of templates. mask_length (List[
opencompass/models/base.py:163
↓ 4 callersMethodget_token
Get a token from the bucket.
opencompass/models/base_api.py:448
↓ 4 callersFunctionhighlight
(row: List[str], meta_col_count: int = META_COL_COUNT)
opencompass/summarizers/multi_model.py:89
↓ 4 callersMethodload
(path: str, local_mode: bool = False)
opencompass/datasets/mbpp.py:29
↓ 4 callersMethodload
Load the dataset using shared .
opencompass/datasets/korbench/korbench.py:20
↓ 4 callersMethodload
(path,train_path, test_path,hf_hub=False)
opencompass/datasets/bioinstruction/evaluator.py:36
↓ 4 callersMethodload
(path: str, prompt_mode: str, discipline: str = None, field: str = None
opencompass/datasets/supergpqa/supergpqa.py:32
↓ 4 callersMethodload
(self, path: str, name: str, alignment_bench_config_path: Optional[str]
opencompass/datasets/subjective/alignbench.py:97
↓ 4 callersMethodload_single
(source_file, desc_list)
opencompass/datasets/rolebench.py:16
↓ 4 callersFunctionlower
(text)
opencompass/datasets/lveval/evaluators.py:160
↓ 4 callersMethodmatch_any_label
(self, pred, test_item)
opencompass/datasets/custom.py:32
↓ 4 callersFunctionmerge_dataframes
(model_name, dataset_abbrs, parsed_data)
opencompass/summarizers/needlebench.py:378
↓ 4 callersFunctionnormalize
Lower text and remove punctuation, articles and extra whitespace.
opencompass/datasets/drop_simple_eval.py:18
↓ 4 callersFunctionnormalize_answer
(text, unit)
opencompass/datasets/tabmwp.py:61
↓ 4 callersFunctionparse_molecule
(molecular_formula)
opencompass/datasets/smolinstruct.py:52
↓ 4 callersMethodparse_template
Parse the intermidate prompt template, and wrap it with meta template if applicable. When the meta template is set and the input is a
opencompass/models/base_api.py:193
↓ 4 callersMethodprint_for_gpt
Complex print function. We often use it as print_for_gpt(pad_space=1, pad_char='> ') However, more complex arguments can be used to
opencompass/datasets/musr/tree.py:293
↓ 4 callersMethodpronunciation_similarity
>>> c = CharFuncs('data/char_meta.txt') >>> c.pronunciation_similarity('牛', '午') 0.27999999999999997 >>> c.pronunciat
opencompass/datasets/lawbench/utils/char_smi.py:302
↓ 4 callersFunctionremove_command
(s, command, keep_inside=False)
opencompass/datasets/phybench/latex_pre_process.py:108
↓ 4 callersFunctionremove_non_alphanumeric
(s)
opencompass/datasets/korbench/korbench_utils.py:397
↓ 4 callersFunctionremove_non_alphanumeric
(s)
opencompass/datasets/supergpqa/supergpqa_utils.py:397
↓ 4 callersFunctionremove_punc
(text)
opencompass/datasets/lveval/evaluators.py:156
↓ 4 callersFunctionsafe_regex_search
(pattern, text, flags=0)
opencompass/datasets/supergpqa/supergpqa_eval.py:8
↓ 4 callersFunctionscale_and_offset
Convert ratings from the natural scale to the Elo rating scale with an anchored baseline.
opencompass/summarizers/subjective/compass_arena_bradley_terry.py:277
↓ 4 callersMethodshape_similarity
>>> c = CharFuncs('data/char_meta.txt') >>> c.shape_similarity('牛', '午') 0.8571428571428572 >>> c.shape_similarity('田
opencompass/datasets/lawbench/utils/char_smi.py:248
↓ 4 callersFunctiontree_edit_distance
We use APTED algorithm proposed by M. Pawlik and N. Augsten github link: https://github.com/DatabaseGroup/apted
opencompass/datasets/lawbench/utils/char_smi.py:39
↓ 3 callersMethod__init__
(self, cfg: argparse.Namespace)
opencompass/datasets/unconditional_protein_generation/omegafold/decode.py:262
↓ 3 callersMethod__init__
(self, input_dim: int)
opencompass/datasets/unconditional_protein_generation/omegafold/embedders.py:149
↓ 3 callersMethod_call
(self, command: str, timeout: Optional[int] = None)
opencompass/lagent/actions/ipython_interpreter.py:125
↓ 3 callersMethod_evaluate
(self, data_sample)
opencompass/datasets/teval/evaluators/review_evaluator.py:71
↓ 3 callersFunction_format_with_fast_chat_template
(inputs: List[str], name: str='vicuna')
opencompass/models/huggingface_above_v4_33.py:92
↓ 3 callersFunction_get_meta_template
(meta_template)
opencompass/models/dummy_hf.py:16
↓ 3 callersMethod_get_point
Pass the input through the linear and perform reshaping for the multi-headed attention, then transform the points by the transformati
opencompass/datasets/unconditional_protein_generation/omegafold/decode.py:175
↓ 3 callersMethod_get_scalar
Pass the input through linear and then perform reshaping for the multi-headed attention Args: linear: the linear
opencompass/datasets/unconditional_protein_generation/omegafold/decode.py:155
↓ 3 callersMethod_process_answer
(self, text)
opencompass/datasets/mbpp.py:309
↓ 3 callersMethod_process_results
Process the evaluation results. Args: outputs (list): List of evaluation results for each test case. prompts (list): L
opencompass/openicl/icl_evaluator/code_evaluator.py:160
↓ 3 callersMethod_set_default_value
(self, cfg: ConfigDict, key: str, value: Any)
opencompass/tasks/openicl_infer.py:144
↓ 3 callersMethodbatch_encode
(self, input_texts: Union[str, List[str]], max_seq_len: int,
opencompass/models/interntrain.py:455
↓ 3 callersFunctionbold
(text)
opencompass/summarizers/multi_model.py:24
↓ 3 callersFunctioncalc_nlg_task_scores
(list_structured_golden, list_structured_predict)
opencompass/datasets/medbench/medbench.py:367
↓ 3 callersFunctioncalc_tree_size
Calculate the size of a subtree based on its total insertion cost. The function computes the size of a subtree by summing up the insertion
opencompass/datasets/phybench/EED.py:73
← previousnext →101–200 of 3,711, ranked by callers