Instructions to use matsuo-lab/weblab-10b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use matsuo-lab/weblab-10b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="matsuo-lab/weblab-10b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("matsuo-lab/weblab-10b") model = AutoModelForCausalLM.from_pretrained("matsuo-lab/weblab-10b") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use matsuo-lab/weblab-10b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "matsuo-lab/weblab-10b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "matsuo-lab/weblab-10b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/matsuo-lab/weblab-10b
- SGLang
How to use matsuo-lab/weblab-10b 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 "matsuo-lab/weblab-10b" \ --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": "matsuo-lab/weblab-10b", "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 "matsuo-lab/weblab-10b" \ --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": "matsuo-lab/weblab-10b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use matsuo-lab/weblab-10b with Docker Model Runner:
docker model run hf.co/matsuo-lab/weblab-10b
Vocabulary seems to be mostly English
#3
by jforan - opened
The tokenizer.json seems to be the same as for the original GPT-NeoX model.
Is there a reason you didn't retrain the vocabulary so as to have more Japanese subtokens? I would have guessed that this would give even better performance in Japanese.
I checked the vocabulary that has more than 3 bytes chars (because most Japanese characters are longer than 3 bytes) and the result was 0. I also want to know how they train the tokenizer.🧐
Token with more than 3 bytes chars
matsuo-lab/weblab-10b: 0 / 50254
rinna/bilingual-gpt-neox-4b 41599 / 65536
The code to count above is as follows.
modelnames =["matsuo-lab/weblab-10b","rinna/bilingual-gpt-neox-4b"]
model_dict = {}
for name in modelnames:
tokenizer = AutoTokenizer.from_pretrained(name)
vocab = tokenizer.convert_ids_to_tokens(range(tokenizer.vocab_size))
model_dict[name]=vocab
def has_multibyte_chars(input_str):
for char in input_str:
return len(char.encode('utf-8')) > 2
print("Token with more than 3 bytes chars")
cnt =0
for modelname in modelnames:
for t in model_dict[modelname]:
if has_multibyte_chars(t) >0:
cnt +=1
print(" "+modelname,cnt,"/",len(model_dict[modelname]))