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
Download configuration_stackifiers.py from Machacini/stackifiers-repo: direct link, hf CLI and curl.
- Browser
- Download file 1.45 kB
-
https://huggingface.co/Machacini/stackifiers-repo/resolve/main/configuration_stackifiers.py
- Command line
-
hf download hf://Machacini/stackifiers-repo/configuration_stackifiers.py
-
curl -L -o configuration_stackifiers.py https://huggingface.co/Machacini/stackifiers-repo/resolve/main/configuration_stackifiers.py
1.45 kB
| """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() | |