Instructions to use Ismantic/Qwen3-1.7B-Base-ReTok with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Ismantic/Qwen3-1.7B-Base-ReTok with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Ismantic/Qwen3-1.7B-Base-ReTok")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Ismantic/Qwen3-1.7B-Base-ReTok") model = AutoModelForCausalLM.from_pretrained("Ismantic/Qwen3-1.7B-Base-ReTok") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Ismantic/Qwen3-1.7B-Base-ReTok with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Ismantic/Qwen3-1.7B-Base-ReTok" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ismantic/Qwen3-1.7B-Base-ReTok", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Ismantic/Qwen3-1.7B-Base-ReTok
- SGLang
How to use Ismantic/Qwen3-1.7B-Base-ReTok 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 "Ismantic/Qwen3-1.7B-Base-ReTok" \ --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": "Ismantic/Qwen3-1.7B-Base-ReTok", "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 "Ismantic/Qwen3-1.7B-Base-ReTok" \ --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": "Ismantic/Qwen3-1.7B-Base-ReTok", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Ismantic/Qwen3-1.7B-Base-ReTok with Docker Model Runner:
docker model run hf.co/Ismantic/Qwen3-1.7B-Base-ReTok
Qwen3-1.7B-Base-ReTok
Qwen3-1.7B-Base-ReTok is a tokenizer-replaced and continued-pretrained variant
of Qwen/Qwen3-1.7B-Base. The original Qwen tokenizer was replaced with a
custom Piece tokenizer, then the model was recovered with continued pretraining.
This is the final tie-preserving v18 checkpoint from the Summer/ReTok
experiments: phase2_ckpt_v18_tie.
Hugging Face repo id: Ismantic/Qwen3-1.7B-Base-ReTok
Important Tokenizer Note
This repository contains the custom tokenizer assets:
piece.modeldict.txttoken_mapping.jsontokenizer_wrapper.py
The model architecture can be loaded by Transformers as Qwen3, but the tokenizer is not a standard Qwen tokenizer. For generation, encode prompts with the provided Piece tokenizer wrapper or the Summer/ReTok evaluation scripts.
Training Summary
- Replaced the original Qwen3-1.7B-Base tokenizer with an 81,903-token Piece tokenizer.
- Initialized new embeddings by mapping each new piece through the original Qwen tokenizer and averaging old embeddings.
- Phase 1: trained new embeddings on about 999M packed tokens while freezing the transformer.
- Phase 2: annealed on about 200M packed tokens with LoRA q/v adapters, Aurora, and tied embedding/head preservation.
See training_lineage.md for the full reproduction record.
Evaluation
WMT22 1000-sample translation:
| Model | zh-en BLEU | zh-en COMET | en-zh BLEU | en-zh COMET |
|---|---|---|---|---|
| Qwen3-1.7B-Base | 22.3408 | 0.8122 | 38.3380 | 0.8597 |
| ReTok v18 Phase 1 | 20.2588 | 0.7821 | 35.1632 | 0.8276 |
| ReTok v18 Phase 2 tie | 20.4599 | 0.7933 | 36.0314 | 0.8444 |
WMT23 full-set translation:
| Model | zh-en BLEU | zh-en COMET | en-zh BLEU | en-zh COMET |
|---|---|---|---|---|
| ReTok v18 Phase 1 | 19.1310 | 0.7767 | 38.8251 | 0.8198 |
| ReTok v18 Phase 2 tie | 19.6046 | 0.7834 | 40.9905 | 0.8377 |
General benchmark results:
| Model | LAMBADA | PIQA | ARC-C | HellaSwag | CEVAL | GSM8K |
|---|---|---|---|---|---|---|
| ReTok v18 Phase 1 | 0.5674 | 0.7301 | 0.5137 | 0.6375 | 0.6263 | 0.0417 |
| ReTok v18 Phase 2 tie | 0.5768 | 0.7367 | 0.5145 | 0.6389 | 0.6204 | 0.0356 |
Limitations
- This is a base model, not an instruction-tuned assistant.
- Generic Hugging Face hosted inference may not work until the custom Piece
tokenizer is packaged as a standard
AutoTokenizerimplementation. - Results remain below the original Qwen3-1.7B-Base on the WMT22 translation sample after tokenizer replacement.
License
The base model Qwen/Qwen3-1.7B-Base is released under Apache 2.0. This
derivative checkpoint is prepared with the same license.
- Downloads last month
- -
Model tree for Ismantic/Qwen3-1.7B-Base-ReTok
Base model
Qwen/Qwen3-1.7B-Base