Views
No views yet
d_model 1024, depth 32, banded attention: three of every four blocks attend within a
256-character window, the fourth globally). Its input is factored into five aligned planes --
letters, word/sentence boundaries, diacritics, capitalization, punctuation -- each of which can
be masked independently to an explicit unknown state at inference. That is what lets one model
read an edited text, scriptio continua, and a lacuna of unknown length without changing
anything but its input.1import torch
2from transformers import AutoModel
3from huggingface_hub import hf_hub_download
4
5REPO = "Ericu950/Stoicheia-macronizer"
6model = AutoModel.from_pretrained(REPO, trust_remote_code=True).eval()
7
8hf_hub_download(repo_id=REPO, filename="processing_char_bert_meter.py", local_dir=".")
9from processing_char_bert_meter import CharBertMeterProcessor
10
11proc = CharBertMeterProcessor()
12batch = proc("ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ")
13with torch.no_grad():
14 out = model(**{k: v for k, v in batch.items() if not k.startswith("_")})
15print(proc.decode_macronization(out, batch)) # ἄ^νδρα^ μοι ἔννεπε, μοῦσα^, ...