File size: 984 Bytes
bfc11a9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# haznitrama/babybabellm-gpt_bert-deu-causal

Rehosted from `suchirsalhan/babybabellm-mono-deu` with standardized remote code and auto_map.
- Original `model_type` preserved.
- Default AutoModel mapping points to GPTBertForCausalLM.
- Added both causal & masked LM wrappers for evaluation.

Example:
```python
from transformers import AutoTokenizer, AutoModel
m='haznitrama/babybabellm-gpt_bert-deu-causal'
tok=AutoTokenizer.from_pretrained(m, trust_remote_code=True)
model=AutoModel.from_pretrained(m, trust_remote_code=True)
print(model(**tok('Hello world', return_tensors='pt')).logits.shape)
```
Generation:
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
m='haznitrama/babybabellm-gpt_bert-deu-causal'
tok=AutoTokenizer.from_pretrained(m, trust_remote_code=True)
model=AutoModelForCausalLM.from_pretrained(m, trust_remote_code=True)
print(tok.decode(model.generate(**tok('Hello', return_tensors='pt'), max_new_tokens=20)[0], skip_special_tokens=True))
```