Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/CarperAI/autocrit
/ functions
Functions
109 in github.com/CarperAI/autocrit
⨍
Functions
109
◇
Types & classes
16
↓ 11 callers
Method
load
(self, **kwargs)
autocrit/inference/inference_hook.py:132
↓ 4 callers
Function
check_apis_available
Returns available APIs with boolean flags :param data: from load_dataset, assumes ['text'] is available :param tokenizer: Tokenizer to t
toolformer/data_generation/api_checker.py:21
↓ 4 callers
Method
generate_continuations
Generate continuations :param input_tokens: input to model :param input_logits: output from model :param labels: lab
toolformer/data_generation/base_api.py:170
↓ 4 callers
Method
infer
input_texts: a list of strings, each string is a prompt generate_params: a dictionary of parameters to pass to the generate function
autocrit/inference/inference_hook.py:141
↓ 4 callers
Method
parse_article
Takes in data dict and parses it into API continuations :param data: data, assuming it's from load_dataset and has a text field
toolformer/data_generation/base_api.py:339
↓ 3 callers
Function
Client
(url: str)
autocrit/inference/triton/client.py:49
↓ 3 callers
Method
__init__
dir: location of the triton server model_name: the name of the model to use tokenizer_name: the name of the tokenizer to use,
autocrit/inference/inference_hook.py:114
↓ 3 callers
Function
evaluate_unsafe
(questions, answers)
experiments/harmless/generate.py:22
↓ 2 callers
Function
clean_continuation
(rating)
Rating/mec_bpc.py:13
↓ 2 callers
Function
extract_data
(file_path)
data_handlers/base_dataset.py:5
↓ 2 callers
Function
extract_data
(file_path)
data_handlers/critique_dataset.py:5
↓ 2 callers
Function
extract_helpful_and_rm_data
(data_path)
data_handlers/helpfulness_dataset.py:5
↓ 2 callers
Function
get_eval
(system_prompt, user_prompt: str)
Rating/mec_bpc.py:35
↓ 2 callers
Function
score_calc
(current_selections)
data_examine/compare_models.py:42
↓ 2 callers
Function
truncate_output
(generate_fn, stop=[])
autocrit.py:120
↓ 1 callers
Function
Calculator
(input_query: str)
toolformer/tools.py:188
↓ 1 callers
Function
Calendar
(date=datetime.datetime.now())
toolformer/tools.py:36
↓ 1 callers
Function
GooseAI
(input_query: str)
toolformer/tools.py:352
↓ 1 callers
Function
HuggingfaceAPI
(input_query: str)
toolformer/tools.py:234
↓ 1 callers
Function
MT
(input_query: str)
toolformer/tools.py:162
↓ 1 callers
Function
SteamSHP
(input_query: str)
toolformer/tools.py:325
↓ 1 callers
Function
WikiSearch
(input_query: str)
toolformer/tools.py:142
↓ 1 callers
Function
WolframAlphaCalculator
(input_query: str)
toolformer/tools.py:266
↓ 1 callers
Method
__init__
(self, traced_model)
autocrit/inference/triton/convert_to_triton.py:45
↓ 1 callers
Function
_bing_search_results
(search_term: str, bing_subscription_key: str, count: int)
toolformer/tools.py:376
↓ 1 callers
Method
add_api_calls
Add API calls here. :param candidate: which candidate is being parsed :param outputs: individual candidate outputs :
toolformer/data_generation/base_api.py:140
↓ 1 callers
Function
best_of_n
Returns the best of n samples from a model :param model: A Huggingface model :param tokenizer: A Huggingface tokenizer :param prompt: A st
autocrit/inference/utils.py:77
↓ 1 callers
Function
bing_search
(input_query: str)
toolformer/tools.py:392
↓ 1 callers
Function
colbertv2_get_request
(url: str, query: str, k: int)
toolformer/tools.py:134
↓ 1 callers
Function
construct_prompt_wizard13b
(input_text)
experiments/PRM/generate_rollouts.py:46
↓ 1 callers
Method
create_candidates
Generates continuations of valid API calls :param indices: index to start :param values: values for filtering :param
toolformer/data_generation/base_api.py:72
↓ 1 callers
Function
create_dict
(dataset)
experiments/PRM/convert_to_steps.py:28
↓ 1 callers
Function
custom_search
(query, api_key, cse_id, **kwargs)
toolformer/tools.py:289
↓ 1 callers
Function
evaluate_acc
(model, tokenizer, train, test, A_token, B_token)
Rating/InstructRate.py:11
↓ 1 callers
Function
extract_data_continuations
(file_path)
data_handlers/base_dataset.py:35
↓ 1 callers
Function
extract_data_continuations
(file_path)
data_handlers/critique_dataset.py:140
↓ 1 callers
Function
extract_rating
(rating)
Rating/mec_bpc.py:20
↓ 1 callers
Method
filter_continuations
Grab continuations that are valid :param input_tokens: tokenized inputs :param input_logits: input logits :param lab
toolformer/data_generation/base_api.py:37
↓ 1 callers
Function
gather
(samples, total_size: int)
autocrit.py:112
↓ 1 callers
Function
generate_markdown_table
(data)
experiments/harmless/show.py:6
↓ 1 callers
Function
get_embedding
(text: str, model="text-embedding-ada-002")
data_handlers/embeddings_for_n_uniques/get_embeddings.py:11
↓ 1 callers
Function
get_eval
(user_prompt: str)
Rating/likert.py:9
↓ 1 callers
Function
get_unique_test_data
(dataset)
data_handlers/embeddings_for_n_uniques/get_embeddings.py:15
↓ 1 callers
Function
google_search
(input_query: str)
toolformer/tools.py:295
↓ 1 callers
Function
infer
( triton_client, model_name, input_ids, new_tokens: int = 1, temperature: float = 1.0 )
autocrit/inference/triton/client.py:33
↓ 1 callers
Function
langchain_llmchain
(input_question)
toolformer/tools.py:209
↓ 1 callers
Function
likert_score
(prompts, outputs)
Rating/likert.py:51
↓ 1 callers
Function
main
()
autocrit/inference/triton/client.py:64
↓ 1 callers
Function
mean_pooling
(token_embeddings: torch.Tensor, mask: torch.Tensor)
toolformer/tools.py:102
↓ 1 callers
Function
mecpbc_score
(systems: Optional[List[str]], prompts: List[str], outputs: List[List[str]])
Rating/mec_bpc.py:86
↓ 1 callers
Function
parse_args
()
experiments/PRM/convert_to_steps.py:20
↓ 1 callers
Function
parse_args
()
experiments/PRM/generate_rollouts.py:22
↓ 1 callers
Function
plot_calibration
(model_name: str, dataset_name: str, delta_scores: np.ndarray)
train_reward_model.py:39
↓ 1 callers
Function
prepare_inference_inputs
Prepare inputs for triton client inference. inputs_ids: torch.IntTensor, shape [batch_size, seq_len] new_tokens: int, number of tokens to
autocrit/inference/utils.py:8
↓ 1 callers
Function
prepare_inference_inputs
( inputs_ids: torch.IntTensor, new_tokens: int = 1, temperature: float = 1.0 )
autocrit/inference/triton/client.py:5
↓ 1 callers
Function
preprocess_dataset
( dataset: Dataset, template: Template, reverse_template: Template, option_a, option_b,
Rating/InstructRate.py:54
↓ 1 callers
Function
query
(payload)
toolformer/tools.py:242
↓ 1 callers
Method
retrieval
( self, input_sentences: List[str], input_text: str, k: int )
toolformer/tools.py:60
↓ 1 callers
Function
split_rollout
(rollout)
experiments/PRM/convert_to_steps.py:8
↓ 1 callers
Function
triton_call
Call triton server for inference. triton_client: tritonclient.grpc.aio.InferenceServerClient model_name: str, name of the model input
autocrit/inference/utils.py:47
Method
__call__
(self, query, k=1)
toolformer/tools.py:127
Method
__call__
( self, input_ids: torch.LongTensor, scores: torch.FloatTensor, **kwargs )
data_examine/generate_continuations.py:20
Method
__init__
(self)
toolformer/tools.py:54
Method
__init__
(self, url: str)
toolformer/tools.py:124
Method
__init__
( self, start_tokens: List[int], end_tokens: List[int], minimum_percentage: fl
toolformer/data_generation/retrieval.py:23
Method
__init__
( self, start_tokens: List[int], end_tokens: List[int], minimum_percentage: fl
toolformer/data_generation/calendar.py:21
Method
__init__
( self, start_tokens: List[int], end_tokens: List[int], minimum_percentage: fl
toolformer/data_generation/llmchain.py:21
Method
__init__
( self, start_tokens: List[int], end_tokens: List[int], minimum_percentage: fl
toolformer/data_generation/calculator.py:21
Method
__init__
Base API Postprocesing class :param start_tokens: token representation for [ or other tokens :param end_tokens: token repre
toolformer/data_generation/base_api.py:18
Method
__init__
(self, dir : str)
autocrit/inference/inference_hook.py:19
Method
__init__
dir: the directory of the model tokenizer_name: the name of the tokenizer to use, if None, use the model name
autocrit/inference/inference_hook.py:43
Method
__init__
dir: the directory of the model tokenizer_name: the name of the tokenizer to use, if None, use the model name
autocrit/inference/inference_hook.py:92
Method
__init__
(self, dir : str)
autocrit/inference/inference_hook.py:170
Method
__init__
(self, model)
autocrit/inference/triton/convert_to_triton.py:35
Method
__init__
(self, stop_ids)
data_examine/generate_continuations.py:17
Method
add_api_calls
( self, candidate: int, outputs: dict, texts_to_test: List[str], token
toolformer/data_generation/retrieval.py:33
Method
add_api_calls
( self, candidate: int, outputs: dict, texts_to_test: List[str], token
toolformer/data_generation/calendar.py:31
Method
add_api_calls
( self, candidate: int, outputs: dict, texts_to_test: List[str], token
toolformer/data_generation/llmchain.py:31
Method
add_api_calls
( self, candidate: int, outputs: dict, texts_to_test: List[str], token
toolformer/data_generation/calculator.py:31
Method
check_any_available
(self)
toolformer/data_generation/api_checker.py:17
Function
collate_fn
(batch)
train_reward_model.py:125
Function
construct_prompt_wizard7b
(input_text)
experiments/PRM/generate_rollouts.py:42
Function
execute_and_wrap
(lam, kwargs)
experiments/PRM/generate_rollouts.py:115
Function
finetune
(accelerator, model, tokenizer, optim, prompts, outputs, eval_prompts=[])
autocrit.py:130
Function
fn
(*args, **kwargs)
autocrit.py:121
Method
forward
(self, input_ids: torch.Tensor)
autocrit/inference/triton/convert_to_triton.py:40
Method
forward
( self, input_ids: torch.Tensor, tensor_of_seq_len: torch.Tensor, temperature:
autocrit/inference/triton/convert_to_triton.py:49
Function
generate
(model, tokenizer, prompts, temperature=1, max_new_tokens=256, max_length=2048, stop=[])
autocrit.py:22
Function
generate_openai
(prompt, model="gpt-3.5-turbo", max_new_tokens=128, system_prompt="", temperature=1, stop=[])
autocrit.py:36
Method
infer
input_texts: a list of strings, each string is a prompt generate_params: a dictionary of parameters to pass to the generate function
autocrit/inference/inference_hook.py:28
Method
infer
input_texts: a list of strings, each string is a prompt generate_params: a dictionary of parameters to pass to the generate function
autocrit/inference/inference_hook.py:67
Method
infer
input_texts: a list of strings, each string is a prompt generate_params: a dictionary of parameters to pass to the generate function
autocrit/inference/inference_hook.py:99
Method
infer
input_texts: a list of strings, each string is a prompt generate_params: a dictionary of parameters to pass to the generate function
autocrit/inference/inference_hook.py:210
Function
left_select
(current_selections, current_index)
data_examine/compare_models.py:16
Method
load
(self, **kwargs)
autocrit/inference/inference_hook.py:24
Method
load
(self, **kwargs)
autocrit/inference/inference_hook.py:58
Method
load
(self, **kwargs)
autocrit/inference/inference_hook.py:175
Method
parse_article
( self, data: dict, model: PreTrainedModel, tokenizer: PreTrainedTokenizerBase )
toolformer/data_generation/retrieval.py:111
Method
parse_article
( self, data: dict, model: PreTrainedModel, tokenizer: PreTrainedTokenizerBase )
toolformer/data_generation/calendar.py:102
Method
parse_article
( self, data: dict, model: PreTrainedModel, tokenizer: PreTrainedTokenizerBase )
toolformer/data_generation/llmchain.py:110
next →
1–100 of 109, ranked by callers