Feature Extraction
Transformers
Safetensors
stackifiers_repo
code
code-quality
regression
repository-scoring
modernbert
custom_code
Instructions to use Machacini/stackifiers-repo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Machacini/stackifiers-repo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="Machacini/stackifiers-repo", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Machacini/stackifiers-repo", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 1,449 Bytes
aa142c2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | """Configuration for the Stackifiers five-score repository regressor."""
from transformers import PretrainedConfig
METRICS = ('pretraining_value', 'repo_quality', 'coding_standard', 'difficulty', 'educational_value')
class StackifiersConfig(PretrainedConfig):
model_type = 'stackifiers_repo'
def __init__(self, backbone_config=None, max_length=8192, head_dropout=0.1,
metrics=None, variant=None, **kwargs):
metrics = list(METRICS if metrics is None else metrics)
if metrics != list(METRICS):
raise ValueError('The five trained score names and their order must be preserved')
for key in ('num_labels', 'problem_type', 'id2label', 'label2id'):
kwargs.pop(key, None)
super().__init__(num_labels=len(metrics), problem_type='regression',
id2label=dict(enumerate(metrics)),
label2id={name: i for i, name in enumerate(metrics)}, **kwargs)
self.backbone_config = dict(backbone_config or {'model_type': 'modernbert'})
self.max_length = max_length
self.head_dropout = head_dropout
self.metrics = metrics
self.variant = variant
self.score_range = [0.0, 5.0]
self.pooling = 'attention-mask-weighted token mean, including special tokens'
self.chunk_aggregation = 'content-token-weighted mean before the scoring head'
StackifiersConfig.register_for_auto_class()
|