compliantLLM / README.md
Martin Navrátil
Upload 11 files
4689b4d verified
|
Raw
History Blame Contribute Delete
1.82 kB
---
library_name: transformers
pipeline_tag: text-generation
tags:
- custom_code
- meme
---
# compliantLLM
`compliantLLM` is a 149,379-parameter custom Hugging Face model trained on 2,048
conversation contexts from `OpenAssistant/oasst1`. Every prompt produces three
output-vocabulary tokens:
```text
Sorry, but that question violates GDPR.<|end_turn|><|eos|>
```
The input side uses an exact 256-entry byte-level, zero-merge BPE vocabulary and
supports a 1,024-token context. The output side has a separate three-token
vocabulary.
## Inference
Install the three runtime dependencies:
```bash
pip install -r requirements.txt
```
Run the bundled entry point:
```bash
python inference.py "Can you process my personal data?"
```
Or use the Hugging Face auto classes:
```python
from transformers import AutoModel, AutoTokenizer
repo = "./compliantLLM"
tokenizer = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModel.from_pretrained(repo, trust_remote_code=True).eval()
inputs = tokenizer(
"Can you process my personal data?",
return_tensors="pt",
truncation=True,
max_length=1024,
)
output_ids = model.generate(**inputs)[0]
print(model.decode_output(output_ids))
```
`trust_remote_code=True` is required because the asymmetric encoder/output
architecture is custom rather than a stock Transformers causal LM.
## Repository contents
- `model.safetensors`: FP32 trained weights
- `config.json`: architecture and output vocabulary
- `configuration_compliant_llm.py`: Transformers configuration
- `modeling_compliant_llm.py`: inference-only model implementation
- `tokenization_compliant_llm.py`: 256-byte tokenizer
- `vocab.json`: tokenizer vocabulary
- `inference.py`: standalone command-line example
The training pipeline and dataset are intentionally excluded.