Instructions to use sanjin7/ctr-ll4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sanjin7/ctr-ll4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="sanjin7/ctr-ll4", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForSequenceClassification model = AutoModelForSequenceClassification.from_pretrained("sanjin7/ctr-ll4", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download src/regression/HF/configs/FullModelConfigHF.py from sanjin7/ctr-ll4: direct link, hf CLI and curl.
- Browser
- Download file 669 Bytes
-
https://huggingface.co/sanjin7/ctr-ll4/resolve/main/src/regression/HF/configs/FullModelConfigHF.py
- Command line
-
hf download hf://sanjin7/ctr-ll4/src/regression/HF/configs/FullModelConfigHF.py
-
curl -L -o FullModelConfigHF.py https://huggingface.co/sanjin7/ctr-ll4/resolve/main/src/regression/HF/configs/FullModelConfigHF.py
669 Bytes
| from transformers import PretrainedConfig | |
| from src.regression.PL import EncoderPL, DecoderPL | |
| from typing import List | |
| class FullModelConfigHF(PretrainedConfig): | |
| model_type = "full_model" | |
| def __init__( | |
| self, | |
| tokenizer_ckpt: str = "", | |
| bert_ckpt: str = "", | |
| decoder_ckpt: str = "", | |
| layer_norm: bool = True, | |
| nontext_features: List[str] = ["aov"], | |
| **kwargs, | |
| ): | |
| self.tokenizer_ckpt = tokenizer_ckpt | |
| self.bert_ckpt = bert_ckpt | |
| self.decoder_ckpt = decoder_ckpt | |
| self.nontext_features = nontext_features | |
| self.layer_norm = layer_norm | |
| super().__init__(**kwargs) | |