Views
No views yet
chengq9/ToolRL-Qwen2.5-3B)Qwen/Qwen2.5-3B)1import torch
2from huggingface_hub import hf_hub_download
3from dfc import DFCCrossCoder
4
5# Download and load the model
6model_path = hf_hub_download(repo_id="antebe1/dfc-crosscoder-qwen-ToolRL",
7 filename="model.pt")
8config_path = hf_hub_download(repo_id="antebe1/dfc-crosscoder-qwen-ToolRL",
9 filename="config.json")
10
11# Load the crosscoder
12dfc = DFCCrossCoder.load("./", device="cuda")
13
14# Example: Extract features from activations
15# activations should be shape (batch_size, 2, 2048) where dim 1 is [model_a, model_b]
16activations = torch.randn(1, 2, 2048) # Replace with real activations
17features = dfc.encode(activations) # Returns sparse feature vector
18
19print(f"Active features: {(features > 0).sum().item()}/{features.shape[-1]}")demo.py for a complete example that shows how to:model.pt: PyTorch model weightsconfig.json: Model configurationdfc.py: CrossCoder implementationdemo.py: Usage example1@misc{dfc-crosscoder,
2 title={DFC CrossCoder: Analyzing Tool-Use vs General Text Features},
3 author={[Andre Shportko]},
4 year={2026},
5 url={https://huggingface.co/your-username/dfc-crosscoder-qwen-ToolRL}
6}