Update README.md
Browse files12 unmodified lines1314151617181920212223242526272829303119 unmodified lines515253414243444546474849505154555612 unmodified lines---# Model Card — logx v0.1.0
Run directly with 🤗 Transformers:
```pythonfrom transformers import AutoModelForSeq2SeqLM, AutoTokenizertok = AutoTokenizer.from_pretrained("path/to/unzipped/model")model = AutoModelForSeq2SeqLM.from_pretrained("path/to/unzipped/model")ids = tok("parse: how many 502s in the last hour", return_tensors="pt").input_idsprint(tok.decode(model.generate(ids, max_length=128)[0], skip_special_tokens=True))# {"action":"count","source":"nginx_access","filters":[{"field":"status","op":"eq","value":"502"}],"time":{"last":"1h"}}```
NL → nginx-log-query translation model. Fine-tune of[`google/t5-efficient-tiny`](https://huggingface.co/google/t5-efficient-tiny)(15.57M params, Apache-2.0) that maps English questions about nginx logs to a19 unmodified lineslogx -q "top 5 ips" -src /var/log/nginx/access.log```
Or directly with 🤗 Transformers:
```pythonfrom transformers import AutoModelForSeq2SeqLM, AutoTokenizertok = AutoTokenizer.from_pretrained("path/to/unzipped/model")model = AutoModelForSeq2SeqLM.from_pretrained("path/to/unzipped/model")ids = tok("parse: how many 502s in the last hour", return_tensors="pt").input_idsprint(tok.decode(model.generate(ids, max_length=128)[0], skip_special_tokens=True))# {"action":"count","source":"nginx_access","filters":[{"field":"status","op":"eq","value":"502"}],"time":{"last":"1h"}}```
The tokenizer is **not** a stock T5 tokenizer: 6 tokens (`< \ ^ { } ~`) wereadded so JSON braces survive encoding, with a patched Metaspace pre-tokenizer.Always load the tokenizer shipped in the zip, never the base model's.README.md+13-11