Prompt
上文:<up to 64 recently committed characters, line omitted when empty>按键:<keys, one letter per token separated by spaces>结果:<text><|endoftext|>
import torchfrom transformers import AutoModelForCausalLM, AutoTokenizer tok = AutoTokenizer.from_pretrained("7eu7d7/beam-ime-0.6b")model = AutoModelForCausalLM.from_pretrained("7eu7d7/beam-ime-0.6b", dtype=torch.bfloat16)prompt = "上文:今晚\n按键:" + " ".join("wmqcfb") + "\n结果:"ids = tok(prompt, return_tensors="pt").input_idsout = model.generate(ids, max_new_tokens=16, num_beams=4, num_return_sequences=3, do_sample=False, pad_token_id=tok.eos_token_id)print([tok.decode(o[ids.shape[1]:], skip_special_tokens=True) for o in out])# ['我们去吃饭吧', '我们去吃饭不', '我们去吃饭呗']
Other outputs from this checkpoint: nihao → 你好, mingtianjian → 明天见, yonglinux → 用Linux.
Adapters
- English translation: translate-en-v1,
a LoRA (r128) trained on this checkpoint with prompt
keys_llm_v4. The release has both a GGUF for Beam and the
PEFT checkpoint; its adapter_config.json names the base beam-0.6b-r5-v2ex, which is this repository.
Training data
LCCC, GeneInput, V2EX, Rime vocabulary, and chat and vocabulary data provided by the maintainer, with synthetic
typing variants (full spelling, initials, mixed prefixes, English words). GeneInput is published without a license;
LCCC is MIT. The training data is not released.
Limitations
Initials are ambiguous and the model picks one reading; it can produce unexpected colloquial choices. Sequence
scores are not confidence estimates; an input method shows several candidates and the user chooses. Inputs are
limited to 40 key letters in Beam.