Downloads · 30 days
57
36% of all-time downloads
Cisco1963/babylm_zho_pinyin_spm
babylm_zho_pinyin_spm is a text generation model from Cisco1963. Use it when you need the model to write or continue text. It is set up for transformers.
This repository contains a custom Transformers causal language model. External evaluation repositories should load it with trustremotecode=True and use the causal backend.
Downloads · 30 days
57
36% of all-time downloads
All-time downloads
157
Public
Parameters
97.7M
783 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors391 MB · 100%
From the Hugging Face model README
This repository contains a custom Transformers causal language model.
External evaluation repositories should load it with
trust_remote_code=True and use the causal backend.
Install the runtime dependencies before loading the model:
pip install torch transformers safetensors sentencepiece pypinyin jieba
sentencepiece is required for AutoTokenizer. pypinyin is required
for raw Mandarin-to-pinyin tokenization. jieba is required when
use_jieba is true; this export was created with use_jieba=true.
from transformers import AutoConfig, AutoModel, AutoModelForCausalLM, AutoTokenizer
model_path = "PATH_OR_REPO_ID"
config = AutoConfig.from_pretrained(model_path, trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
base_model = AutoModel.from_pretrained(model_path, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_path, trust_remote_code=True)
Configure external evaluators with:
causalThe tokenizer accepts raw text through standard calls such as
tokenizer(text), tokenizer(text, add_special_tokens=False), and
tokenizer(texts, padding=True, truncation=True, return_tensors="pt").
It also accepts return_offsets_mapping=True for compatibility with
completion-ranking evaluators that need suffix masks. The model supports
output_hidden_states=True for representation extraction tasks.
This export sets patch_pathlib_utf8_open=true in config.json.
When loaded with trust_remote_code=True, the config installs a narrow
Windows compatibility shim so later text-mode Path.open("r") calls
without an explicit encoding default to UTF-8. Set
PINYIN_CODE_DISABLE_UTF8_OPEN_PATCH=1 before loading the model to
disable that shim.
Export metadata:
pinyin-codetrue