MCPcopy Create free account

hub / github.com/GXimingLu/Quark / functions

Functions75 in github.com/GXimingLu/Quark

↓ 9 callersFunctionreduce_mean
(value, mask, axis=None)
utils/utils.py:20
↓ 7 callersMethodadd
(self, prompts: List[str], responses: List[str], scores: List[float])
data_pool.py:13
↓ 6 callersMethodupdate
(self, current, n_steps, lower_bound)
main.py:96
↓ 5 callersMethoddecode
(self, query_input_ids, response_input_ids=None)
main.py:163
↓ 4 callersFunctionreduce_sum
(value, mask, axis=None)
utils/utils.py:14
↓ 4 callersMethodrequest
(self, texts: Union[str, List[str]])
utils/perspective_api.py:58
↓ 3 callersMethodforward_pass
(self, query_input_ids: torch.Tensor, query_mask: torch.Tensor,
policy.py:149
↓ 3 callersFunctionmask_pad
(value, mask)
utils/utils.py:35
↓ 2 callersMethodadd_control_code
(self, input_ids, attention_mask)
main.py:158
↓ 2 callersFunctionbatchify
(data: Iterable[T], batch_size: int)
utils/utils.py:96
↓ 2 callersFunctioncollate
(dataset: Optional[pd.DataFrame], generations: List[str], responses: Iterable[Dict[str
reward.py:61
↓ 2 callersFunctionensure_dir
(d)
utils/utils.py:91
↓ 2 callersMethodeval
(self, step)
main.py:307
↓ 2 callersFunctionexpand
(tensor, num_repeat)
sample.py:55
↓ 2 callersMethodget_reward
(self, prompts: List[str], responses: List[str], epoch: str)
reward.py:26
↓ 2 callersFunctionload_jsonl
(file: Union[str, Path])
utils/utils.py:120
↓ 2 callersMethodprepare_inputs_for_generation
(self, input_ids, past=None, **kwargs)
model/gpt2.py:30
↓ 2 callersMethodsample
(self, step)
main.py:174
↓ 2 callersMethodstop
(self)
utils/perspective_api.py:172
↓ 1 callersMethod_make_request
(text: str, service)
utils/perspective_api.py:134
↓ 1 callersMethod_make_service
(api_key: str)
utils/perspective_api.py:126
↓ 1 callersFunctionceil_div
(a, b)
utils/utils.py:43
↓ 1 callersFunctionchunks
Yield successive n-sized chunks from lst.
sample.py:59
↓ 1 callersFunctionconditional_perplexity
(generations_df, model, tokenizer, device='cuda')
perplexity.py:11
↓ 1 callersFunctiondistinctness
(responses, num_sample)
sample.py:65
↓ 1 callersFunctiondistinctness
(generations)
utils/utils.py:76
↓ 1 callersFunctionget_args
()
arguments.py:5
↓ 1 callersMethodget_data
(self)
data_pool.py:28
↓ 1 callersFunctionload_cache
(file: Path)
utils/utils.py:126
↓ 1 callersFunctionlogits_to_entropy
(logits)
utils/utils.py:30
↓ 1 callersMethodloss
(self, step, query_input_ids, query_mask, response_input_ids, response_mask)
main.py:240
↓ 1 callersFunctionmain
()
main.py:345
↓ 1 callersFunctionmake_generations_col
(generations, responses)
utils/perspective_api.py:40
↓ 1 callersMethodprint_samples
(self, queries, responses, lm_loss, logprobs, ref_logprobs, masks, step)
main.py:286
↓ 1 callersFunctionrec
(nest, prefix, into)
utils/utils.py:63
↓ 1 callersMethodrecord_step_stats
(self, data)
main.py:268
↓ 1 callersFunctionreduce_std
(value, mask)
utils/utils.py:26
↓ 1 callersMethodrequest_bulk
(self, corpus: Union[Iterable[str], Iterable[Tuple[str, str]]], outp
utils/perspective_api.py:85
↓ 1 callersFunctionreward_to_toxicity
(score)
reward.py:57
↓ 1 callersMethodsample
(self, prompts: Union[str, List[str]] = None, input_ids: torch.Tensor = None,
policy.py:35
↓ 1 callersMethodsave
(self, step)
main.py:297
↓ 1 callersMethodstep
(self, step_num)
main.py:204
↓ 1 callersFunctiontoxicity_to_reward
(score)
reward.py:51
↓ 1 callersFunctionunpack_scores
(response_json: dict)
utils/perspective_api.py:16
Method__call__
(self, sequences)
main.py:45
Method__call__
(self, sequences)
main.py:73
Method__call__
(self, request_id: str, text: str)
utils/perspective_api.py:165
Method__getitem__
(self, idx)
main.py:37
Method__getitem__
(self, idx)
main.py:62
Method__init__
(self, save_path: str, rate_limit: int, batch_size: int)
reward.py:21
Method__init__
(self, tree_tokens, n_extra_tokens)
data_pool.py:6
Method__init__
(self, model_name, temperature, device, reward_cond=False, tree_tokens=None)
policy.py:11
Method__init__
(self, path)
main.py:31
Method__init__
(self, tokenizer)
main.py:42
Method__init__
(self, data_pool: DataPool)
main.py:56
Method__init__
(self, tokenizer)
main.py:70
Method__init__
(self, coef)
main.py:93
Method__init__
(self, init_coef, target, horizon)
main.py:101
Method__init__
(self, params: argparse.Namespace, policy: Policy, ref_poli
main.py:116
Method__init__
(self, api_key: str = PERSPECTIVE_API_KEY, rate_limit: int = 25)
utils/perspective_api.py:52
Method__init__
(self, out_file: Path, total: int, rate_limit: int)
utils/perspective_api.py:147
Method__init__
(self, config)
model/gpt2.py:11
Method__len__
(self)
main.py:34
Method__len__
(self)
main.py:59
Functionclamp
(value, min_value, max_value)
utils/utils.py:39
Functionexact_div
(a, b)
utils/utils.py:47
Functionflatten_dict
(nested, sep='.')
utils/utils.py:62
Methodforward
r""" labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for computing the sequence classification/regression
model/gpt2.py:58
Methodget_reward
(self, prompts: List[str], responses: List[str], epoch: str)
reward.py:47
Methodperspective_worker
(cls, queue: mp.Queue, responses_file: Path, total: int, rate_limit: int)
utils/perspective_api.py:181
Methodresponse_callback
(request_id, response, exception)
utils/perspective_api.py:73
Functionset_seed
(seed, n_gpu)
utils/utils.py:113
Functiontest_perspective_api
()
utils/perspective_api.py:188
Methodupdate
(self, current, n_steps, lower_bound)
main.py:106
Functionwhiten
(values, masks, shift_mean=True)
utils/utils.py:54