Instructions to use NeTSlab/gpt2_parfind_en_nl_zh_equal with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NeTSlab/gpt2_parfind_en_nl_zh_equal with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NeTSlab/gpt2_parfind_en_nl_zh_equal")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("NeTSlab/gpt2_parfind_en_nl_zh_equal") model = AutoModelForCausalLM.from_pretrained("NeTSlab/gpt2_parfind_en_nl_zh_equal") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use NeTSlab/gpt2_parfind_en_nl_zh_equal with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NeTSlab/gpt2_parfind_en_nl_zh_equal" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NeTSlab/gpt2_parfind_en_nl_zh_equal", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/NeTSlab/gpt2_parfind_en_nl_zh_equal
- SGLang
How to use NeTSlab/gpt2_parfind_en_nl_zh_equal with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "NeTSlab/gpt2_parfind_en_nl_zh_equal" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NeTSlab/gpt2_parfind_en_nl_zh_equal", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "NeTSlab/gpt2_parfind_en_nl_zh_equal" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NeTSlab/gpt2_parfind_en_nl_zh_equal", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use NeTSlab/gpt2_parfind_en_nl_zh_equal with Docker Model Runner:
docker model run hf.co/NeTSlab/gpt2_parfind_en_nl_zh_equal
gpt2_parfind_en_nl_zh_equal
Multilingual GPT-2 model for the BabyLM 2026 multilingual setting, paired with a custom ParadigmFinder tokenizer trained on English, Dutch, and Chinese.
This export comes from:
- tokenizer experiment:
toktrain_ParFindFast_ML_BD_budget16k_zhchildes_v1.0 - model experiment:
model_gpt2_ParFindFast_ML_BD_budget16k_zhchildes_v1.0
The model and tokenizer are packaged together for direct Hugging Face upload. Because the tokenizer uses custom code, loading requires trust_remote_code=True.
Model
- architecture:
GPT2LMHeadModel - layers:
12 - attention heads:
12 - hidden size:
768 - max positions:
1024 - training sequence length:
512 - exported model vocab size:
44090
Tokenizer
- class:
EnhancedParadigmTokenizerWrapper - paradigm family:
ParadigmFinder - boundary discovery:
true - boundary discovery mode:
space_free_only - multilingual budgeting: soft merge
- budget per language:
16384 - languages:
eng,nld,zho
This tokenizer includes the custom runtime files needed for HF loading:
tokenizer.pyboundary_discovery.pypreprocessing.pyparadigm_utils.pyparadigms.jsonmultilingual_meta.json
Training Data
The model was trained on the BabyLM 2026 multilingual corpus selection used in this repo, with aligned tokenizer training and LM training over the same multilingual data source.
Languages:
- English
- Dutch
- Chinese
Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
repo_id = "NeTSlab/gpt2_parfind_en_nl_zh_equal"
tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(repo_id)
prompt = "The child looked at"
inputs = tokenizer(prompt, return_tensors="pt")
output = model.generate(**inputs, max_new_tokens=30)
print(tokenizer.decode(output[0]))
If your Hugging Face cache is not writable, set:
export HF_HOME=/tmp/hf_cache
Notes
- This is a BabyLM-scale research model, not a production general-purpose LM.
- The tokenizer uses custom remote code, so some environments may need
trust_remote_code=True. - The multilingual vocabulary budget is equal per language at configuration time, but the final merged vocabulary is derived after deduplication.
- Downloads last month
- 1,217