File size: 1,820 Bytes
947c1b0
4689b4d
 
 
 
 
947c1b0
4689b4d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
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.