MCPcopy Index your code
hub / github.com/CarperAI/autocrit

github.com/CarperAI/autocrit @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
125 symbols 601 edges 37 files 19 documented · 15%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

AutoCrit

A repository for transformer critique learning and generation.

Scalar reward models

Train OpenLLaMA-13B on Helpful and Harmless dataset:

accelerate launch --config_file configs/accelerate/zero2.yaml \
           train_reward_model.py \
           --model_path openlm-research/open_llama_13b \
           --dataset pvduy/rm_oa_hh \
           --batch_size 1 \
           --eval_interval 1000 \
           --lr 0.00001 \
           --weight_decay 0 \
           --num_unfrozen_layers 12 \
           --gradient_checkpointing \
           --checkpoint_dir checkpoints \
           --calibration_datasets reciprocate/vicuna-fair-eval

Usage:

from transformers import AutoModelForSequenceClassification, AutoTokenizer

ckpt = "reciprocate/openllama-13b_rm_oasst-hh"
model = AutoModelForSequenceClassification.from_pretrained(ckpt, load_in_4bit=True)
tokenizer = AutoTokenizer.from_pretrained(ckpt)

model(**tokenizer("ASSISTANT: This sentence is a lie.", return_tensors="pt"))[0].item()

Output:

-1.626953125

Core symbols most depended-on inside this repo

load
called by 11
autocrit/inference/inference_hook.py
generate_continuations
called by 4
toolformer/data_generation/base_api.py
parse_article
called by 4
toolformer/data_generation/base_api.py
check_apis_available
called by 4
toolformer/data_generation/api_checker.py
infer
called by 4
autocrit/inference/inference_hook.py
evaluate_unsafe
called by 3
experiments/harmless/generate.py
Client
called by 3
autocrit/inference/triton/client.py
truncate_output
called by 2
autocrit.py

Shape

Function 66
Method 43
Class 16

Languages

Python100%

Modules by API surface

toolformer/tools.py22 symbols
autocrit/inference/inference_hook.py19 symbols
toolformer/data_generation/base_api.py7 symbols
autocrit.py7 symbols
autocrit/inference/triton/convert_to_triton.py6 symbols
train_reward_model.py5 symbols
experiments/PRM/generate_rollouts.py5 symbols
data_examine/compare_models.py5 symbols
toolformer/data_generation/retrieval.py4 symbols
toolformer/data_generation/llmchain.py4 symbols
toolformer/data_generation/calendar.py4 symbols
toolformer/data_generation/calculator.py4 symbols

For agents

$ claude mcp add autocrit \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact