Instructions to use QuantFactory/shisa-7b-v1-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use QuantFactory/shisa-7b-v1-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf QuantFactory/shisa-7b-v1-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf QuantFactory/shisa-7b-v1-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf QuantFactory/shisa-7b-v1-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf QuantFactory/shisa-7b-v1-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf QuantFactory/shisa-7b-v1-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf QuantFactory/shisa-7b-v1-GGUF:Q4_K_M
Use Docker
docker model run hf.co/QuantFactory/shisa-7b-v1-GGUF:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use QuantFactory/shisa-7b-v1-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "QuantFactory/shisa-7b-v1-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "QuantFactory/shisa-7b-v1-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/QuantFactory/shisa-7b-v1-GGUF:Q4_K_M
- Ollama
How to use QuantFactory/shisa-7b-v1-GGUF with Ollama:
ollama run hf.co/QuantFactory/shisa-7b-v1-GGUF:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use QuantFactory/shisa-7b-v1-GGUF with Docker Model Runner:
docker model run hf.co/QuantFactory/shisa-7b-v1-GGUF:Q4_K_M
- Lemonade
How to use QuantFactory/shisa-7b-v1-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull QuantFactory/shisa-7b-v1-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.shisa-7b-v1-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
QuantFactory/shisa-7b-v1-GGUF
This is quantized version of augmxnt/shisa-base-7b-v1 created using llama.cpp
Model Description
shisa-base-7b-v1 takes Mistral 7B and adds an additional 8B tokens of primarily Japanese pre-training. Japanese tokens were sourced from MADLAD-400, using DSIR, along with 10% English tokens sampled from a mix of MADLAD-400 EN and various open datasources added in to prevent catastrophic forgetting.
We have extended the Mistral tokenizer to 120k tokens to improve Japanese efficiency. Our tokenizer achieves ~2.3 characters per token in JA, versus the base Mistral 7B tokenizer which is <1 character per token. Code for our implementation is available in our Shisa repo.
This base model was created for use with Shisa 7B, our JA/EN fine-tuned model, but we provide it for the community as we believe the combination of strong performance and efficient bilingual tokenizer could be useful.
Training took 2,400 A100-40 GPU hours on a single 16 x A100-40 machine with DeepSpeed ZeRO-3. (WandB logs)
Performance
This base model was able to attain class-leading Japanese performance in standardized benchmarks with significantly less additional pre-training than previously released models. We speculate this may be due to the use of a better-curated pre-training dataset, but ablations at even 2.5B additional JA tokens still showed very strong Japanese performance.
We used a slightly modified llm-jp-eval (our base model requires a bos_token to be prepended to the prompt; we tested other models with and without the modification and took the higher results for all models tested). Here we validate versus the original Mistral 7B base model as well as Japanese Stable LM Instruct Gamma 7B, which is a Mistral 7B base with an additional 100B tokens of JA/EN pre-training. We also include Japanese-StableLM-Base-Beta-70B, which is a Llama 2 70B that also has an additional 100B tokens of JA/EN pre-training as a reference:
Here we also compare shisa-base-7b-v1 to other recently-released similar classed (7B parameter) Japanese-tuned models. ELYZA 7B fast model and Youri 7B are Llama 2 7B models with 18B and 40B of additional pre-training respectively, and CALM2-7B and llm-jp-13b are pretrained models with 1.3T and 300B JA/EN tokens of pre-training:
Tokenizer
As mentioned in the introduction, our tokenizer is an extended version of the Mistral 7B tokenizer, with a vocab size of 120073 and aligned to 120128 for better performance. The remaining unused tokens are assigned as zero-weighted <|extra_{idx}|> tokens.
We use the "Fast" tokenizer, which should be the default for AutoTokenizer, but if you have problems, make sure to check tokenizer.is_fast or to initialize with use_fast=True.
Japanese efficiency from sampling 50K items (~85M characters) from the JA subset of the CulturaX dataset:
| LLM | Tokenizer | Vocab Size | Avg Char/Token |
|---|---|---|---|
| Shisa 7B (AUGMXNT) | augmxnt/shisa-base-7b-v1 | 120073 | 2.31 |
| OpenCALM (CyberAgent) | cyberagent/open-calm-7b | 52000 | 2.17 |
| Japanese LargeLM (LINE) | line-corporation/japanese-large-lm-3.6b | 51200 | 2.14 |
| CALM2-7B (CyberAgent) | cyberagent/calm2-7b | 65000 | 2.00 |
| Bilingual-GPT-NeoX-4B (Rinna) | rinna/bilingual-gpt-neox-4b | 65536 | 1.88 |
| Japanese StableLM Alpha (Stability AI) | novelai/nerdstash-tokenizer-v1 | 65535 | 1.85 |
| Japanese-GPT-NeoX-3.6B (Rinna) | rinna/japanese-gpt-neox-3.6b | 32000 | 1.83 |
| Japanese StableLM Beta JAVocab (Stability AI) | stabilityai/japanese-stablelm-base-ja_vocab-beta-7b | 49247 | 1.79 |
| llm-jp-13b (LLM-jp) | llm-jp/llm-jp-13b-v1.0 | 50570 | 1.65 |
| Japanese-Llama-2-7b-fast (ELYZA) | elyza/ELYZA-japanese-Llama-2-7b-fast | 45043 | 1.53 |
| Qwen 14B (Qwen) | Qwen/Qwen-14B | 151851 | 1.48 |
| weblab-10b (Matsuo Lab) | EleutherAI/gpt-neox-20b | 50254 | 1.00 |
| Japanese StableLM Gamma (Stability AI) | mistralai/Mistral-7B-v0.1 | 32000 | 0.95 |
| Youri 7B (Rinna) | meta-llama/Llama-2-7B | 32000 | 0.88 |
We also test English efficiency using a sampling of 50K items (~177M characters) from the EN subset of the CulturaX dataset as a sanity check (and to see how other tokenizers fare):
| LLM | Tokenizer | Vocab Size | Avg Char/Token |
|---|---|---|---|
| Qwen 14B (Qwen) | Qwen/Qwen-14B | 151851 | 4.47 |
| weblab-10b (Matsuo Lab) | EleutherAI/gpt-neox-20b | 50254 | 4.45 |
| Japanese StableLM Alpha (Stability AI) | novelai/nerdstash-tokenizer-v1 | 65535 | 4.15 |
| Shisa 7B (AUGMXNT) | augmxnt/shisa-base-7b-v1 | 120073 | 4.12 |
| CALM2-7B (CyberAgent) | cyberagent/calm2-7b | 65000 | 4.12 |
| Japanese StableLM Beta JAVocab (Stability AI) | stabilityai/japanese-stablelm-base-ja_vocab-beta-7b | 49247 | 4.01 |
| Japanese StableLM Gamma (Stability AI) | mistralai/Mistral-7B-v0.1 | 32000 | 4.01 |
| Japanese-Llama-2-7b-fast (ELYZA) | elyza/ELYZA-japanese-Llama-2-7b-fast | 45043 | 3.86 |
| Youri 7B (Rinna) | meta-llama/Llama-2-7B | 32000 | 3.86 |
| llm-jp-13b (LLM-jp) | llm-jp/llm-jp-13b-v1.0 | 50570 | 3.79 |
| OpenCALM (CyberAgent) | cyberagent/open-calm-7b | 52000 | 2.83 |
| Japanese LargeLM (LINE) | line-corporation/japanese-large-lm-3.6b | 51200 | 2.49 |
| Japanese-GPT-NeoX-3.6B (Rinna) | rinna/japanese-gpt-neox-3.6b | 32000 | 2.42 |
| Bilingual-GPT-NeoX-4B (Rinna) | rinna/bilingual-gpt-neox-4b | 65536 | 2.42 |
With our extended tokenizer, we are able to achieve class-leading JA token efficiency without any losses in EN performance vs the base tokenizer. This bears out in our testing, and we often see >2X JA inference speedups with our tokenizer.
Acknowledgements
Team: Jon Durbin, Leonard Lin
Compute for this model was generously sponsored by AKA Virtual (Tokyo, Japan).
Thanks to the ELYZA team for publishing the details of their tokenizer extension approach which we used as a starting point for our tokenizer.
And of course, thanks to the Mistral AI for releasing such a strong base model!
(GPT-4ใซใใฃใฆ็ฟป่จณใใใพใใ)
shisa-base-7b-v1
shisa-base-7b-v1ใฏใMistral 7Bใๅบใซใใฆใไธปใซๆฅๆฌ่ชใฎไบๅใใฌใผใใณใฐใฎใใใซ่ฟฝๅ ใง80ๅใใผใฏใณใ่ฟฝๅ ใใฆใใพใใๆฅๆฌ่ชใใผใฏใณใฏใMADLAD-400ใใๅๅพใใDSIRใไฝฟ็จใใฆใใพใใใใใซใMADLAD-400 ENใจๆงใ
ใชใชใผใใณใใผใฟใฝใผในใใใฎ่ฑ่ชใใผใฏใณใฎ10%ใ่ฟฝๅ ใใๅฃๆป
็ๅฟๅดใ้ฒใใใใซ็ตใฟ่พผใใงใใพใใ
Mistralใฎใใผใฏใณๅๅจใ12ไธใใผใฏใณใพใงๆกๅผตใใๆฅๆฌ่ชใฎๅน็ใๅไธใใใพใใใ็งใใกใฎใใผใฏใณๅๅจใฏJAใงใใผใฏใณใใใ็ด2.3ๆๅญใๅฎ็พใใฆใใใๅบๆฌ็ใชMistral 7Bใฎใใผใฏใณๅๅจใฏใใผใฏใณใใใ<1ๆๅญใงใใ็งใใกใฎๅฎ่ฃ ใฎใณใผใใฏใShisaใชใใธใใชใงๅฉ็จๅฏ่ฝใงใใ
ใใฎใใผในใขใใซใฏใShisa 7Bใ็งใใกใฎJA/ENใใกใคใณใใฅใผใใณใฐใขใใซ็จใซไฝๆใใใพใใใใๅผทๅใชใใใฉใผใใณในใจๅน็็ใชใใคใชใณใฌใซใใผใฏใณๅๅจใฎ็ตใฟๅใใใๆ็จใงใใใจ่ใใใณใใฅใใใฃใซๆไพใใฆใใพใใ
ใใฌใผใใณใฐใซใฏใ16 x A100-40ใใทใณใง2,400 A100-40 GPUๆ้ใไฝฟ็จใใDeepSpeed ZeRO-3ใง่กใใพใใใ(WandB ใญใฐ)
ใใใฉใผใใณใน
ใใฎใใผในใขใใซใฏใไปฅๅใซใชใชใผในใใใใขใใซใใใใฏใใใซๅฐใชใ่ฟฝๅ ไบๅใใฌใผใใณใฐใงใๆจๆบใใณใใใผใฏใซใใใฆๆฅๆฌ่ชๆง่ฝใฎๅ ้ ญใๅใใใจใใงใใพใใใใใใฏใใใ่ฏใใญใฅใฌใผใทใงใณใใใไบๅใใฌใผใใณใฐใใผใฟใปใใใฎไฝฟ็จใซใใใใฎใใใใใพใใใใ25ๅ่ฟฝๅ JAใใผใฏใณใงใฎใขใใฌใผใทใงใณใงใ้ๅธธใซๅผทๅใชๆฅๆฌ่ชใใใฉใผใใณในใ็คบใใพใใใ
็งใใกใฏใใใใใซๅคๆดใใใllm-jp-evalใไฝฟ็จใใพใใ๏ผ็งใใกใฎใใผในใขใใซใฏใใใญใณใใใซbos_tokenใ่ฟฝๅ ใใๅฟ
่ฆใใใใพใใไปใฎใขใใซใซใคใใฆใใๅคๆดใฎๆ็กใซใใใใใใในใใใใในใฆใฎใขใใซใงใในใใใใ้ซใ็ตๆใๅใใพใใ๏ผใใใใงใฏใๅ
ใฎMistral 7Bใใผในใขใใซใใใณๆฅๆฌ่ชStable LM Instruct Gamma 7B๏ผใใใฏMistral 7Bใใผในใงใใใ่ฟฝๅ ใฎ1000ๅJA/ENใใผใฏใณใฎไบๅใใฌใผใใณใฐใ่กใใใฆใใพใ๏ผใจๆฏ่ผใใพใใใพใใJapanese-StableLM-Base-Beta-70B๏ผใใใฏLlama 2 70Bใงใ่ฟฝๅ ใฎ1000ๅJA/ENใใผใฏใณใฎไบๅใใฌใผใใณใฐใ่กใใใฆใใพใ๏ผใๅ่ใซๅซใพใใฆใใพใใ
ใใใงใฏใshisa-base-7b-v1ใไปใฎๆ่ฟใชใชใผในใใใๅใใฏใฉใน๏ผ7Bใใฉใกใผใฟ๏ผใฎๆฅๆฌ่ชใใฅใผใใณใฐใขใใซใจใๆฏ่ผใใพใใELYZA 7B fast modelใใใณYouri 7BใฏLlama 2 7Bใขใใซใงใใใใใ180ๅใจ400ๅใฎ่ฟฝๅ ไบๅใใฌใผใใณใฐใใใใพใใใพใใCALM2-7Bใจllm-jp-13bใฏใ1.3Tใใใณ3000ๅJA/ENใใผใฏใณใฎไบๅใใฌใผใใณใฐใ่กใฃใใใชใใฌใผใใณใฐใขใใซใงใใ
ใใผใฏใณๅๅจ
ๅบๆใง่งฆใใใใใซใ็งใใกใฎใใผใฏใณๅๅจใฏMistral 7Bใใผใฏใณๅๅจใฎๆกๅผต็ใงใ่ชๅฝใตใคใบใฏ120073ใงใใใ120128ใซๅใใใใใฆใใพใใๆฎใใฎๆชไฝฟ็จใใผใฏใณใฏใใผใญ้ใฟไปใใใใ<|extra_{idx}|>ใใผใฏใณใจใใฆๅฒใๅฝใฆใใใฆใใพใใ
็งใใกใฏใFastใใใผใฏใณๅๅจใไฝฟ็จใใฆใใใใใใฏAutoTokenizerใฎใใใฉใซใใงใใในใใงใใใๅ้กใใใๅ ดๅใฏtokenizer.is_fastใใใงใใฏใใใใuse_fast=Trueใงๅๆๅใใใใจใ็ขบ่ชใใฆใใ ใใใ
CulturaXใใผใฟใปใใใฎJAใตใใปใใใใ50Kใขใคใใ ๏ผ็ด8500ไธๆๅญ๏ผใใตใณใใชใณใฐใใ้ใฎๆฅๆฌ่ชๅน็๏ผ
| LLM | ใใผใฏใณๅๅจ | ่ชๅฝใตใคใบ | 1ใใผใฏใณใใใใฎๅนณๅๆๅญๆฐ |
|---|---|---|---|
| Shisa 7B (AUGMXNT) | augmxnt/shisa-base-7b-v1 | 120073 | 2.31 |
| OpenCALM (CyberAgent) | cyberagent/open-calm-7b | 52000 | 2.17 |
| Japanese LargeLM (LINE) | line-corporation/japanese-large-lm-3.6b | 51200 | 2.14 |
| CALM2-7B (CyberAgent) | cyberagent/calm2-7b | 65000 | 2.00 |
| Bilingual-GPT-NeoX-4B (Rinna) | rinna/bilingual-gpt-neox-4b | 65536 | 1.88 |
| Japanese StableLM Alpha (Stability AI) | novelai/nerdstash-tokenizer-v1 | 65535 | 1.85 |
| Japanese-GPT-NeoX-3.6B (Rinna) | rinna/japanese-gpt-neox-3.6b | 32000 | 1.83 |
| Japanese StableLM Beta JAVocab (Stability AI) | stabilityai/japanese-stablelm-base-ja_vocab-beta-7b | 49247 | 1.79 |
| llm-jp-13b (LLM-jp) | llm-jp/llm-jp-13b-v1.0 | 50570 | 1.65 |
| Japanese-Llama-2-7b-fast (ELYZA) | elyza/ELYZA-japanese-Llama-2-7b-fast | 45043 | 1.53 |
| Qwen 14B (Qwen) | Qwen/Qwen-14B | 151851 | 1.48 |
| weblab-10b (Matsuo Lab) | EleutherAI/gpt-neox-20b | 50254 | 1.00 |
| Japanese StableLM Gamma (Stability AI) | mistralai/Mistral-7B-v0.1 | 32000 | 0.95 |
| Youri 7B (Rinna) | meta-llama/Llama-2-7B | 32000 | 0.88 |
ใพใใCulturaXใใผใฟใปใใใฎENใตใใปใใใใ50Kใขใคใใ ๏ผ็ด1ๅ7700ไธๆๅญ๏ผใใตใณใใชใณใฐใใฆใ่ฑ่ชๅน็ใใในใใใพใใใใใใฏๅฅๅ จๆงใใงใใฏ๏ผใใใณไปใฎใใผใฏใณๅๅจใฎใใใฉใผใใณในใ็ขบ่ชใใใใ๏ผใจใใฆ่กใใใพใ๏ผ
| LLM | ใใผใฏใณๅๅจ | ่ชๅฝใตใคใบ | 1ใใผใฏใณใใใใฎๅนณๅๆๅญๆฐ |
|---|---|---|---|
| Qwen 14B (Qwen) | Qwen/Qwen-14B | 151851 | 4.47 |
| weblab-10b (Matsuo Lab) | EleutherAI/gpt-neox-20b | 50254 | 4.45 |
| Japanese StableLM Alpha (Stability AI) | novelai/nerdstash-tokenizer-v1 | 65535 | 4.15 |
| Shisa 7B (AUGMXNT) | augmxnt/shisa-base-7b-v1 | 120073 | 4.12 |
| CALM2-7B (CyberAgent) | cyberagent/calm2-7b | 65000 | 4.12 |
| Japanese StableLM Beta JAVocab (Stability AI) | stabilityai/japanese-stablelm-base-ja_vocab-beta-7b | 49247 | 4.01 |
| Japanese StableLM Gamma (Stability AI) | mistralai/Mistral-7B-v0.1 | 32000 | 4.01 |
| Japanese-Llama-2-7b-fast (ELYZA) | elyza/ELYZA-japanese-Llama-2-7b-fast | 45043 | 3.86 |
| Youri 7B (Rinna) | meta-llama/Llama-2-7B | 32000 | 3.86 |
| llm-jp-13b (LLM-jp) | llm-jp/llm-jp-13b-v1.0 | 50570 | 3.79 |
| OpenCALM (CyberAgent) | cyberagent/open-calm-7b | 52000 | 2.83 |
| Japanese LargeLM (LINE) | line-corporation/japanese-large-lm-3.6b | 51200 | 2.49 |
| Japanese-GPT-NeoX-3.6B (Rinna) | rinna/japanese-gpt-neox-3.6b | 32000 | 2.42 |
| Bilingual-GPT-NeoX-4B (Rinna) | rinna/bilingual-gpt-neox-4b | 65536 | 2.42 |
็งใใกใฎๆกๅผตใใผใฏใณๅๅจใไฝฟ็จใใใใจใงใๅบๆฌใใผใฏใณๅๅจใจๆฏ่ผใใฆENใใใฉใผใใณในใฎๆๅคฑใชใใใฏใฉในๆ้ซใฎJAใใผใฏใณๅน็ใๅฎ็พใงใใพใใใใใใฏ็งใใกใฎใในใใงๅฎ่จผใใใฆใใใใใผใฏใณๅๅจใไฝฟ็จใใใใจใงJAๆจ่ซ้ๅบฆใ2ๅไปฅไธใซใชใใใจใใใฐใใฐใใใพใใ
่ฌ่พ
ใใผใ ๏ผJon DurbinใLeonard Lin
ใใฎใขใใซใฎ่จ็ฎใฏใAKA Virtual๏ผๆฅๆฌใๆฑไบฌ๏ผใซใใฃใฆๅฏๅคงใซๆไพใใใพใใใ
ELYZAใใผใ ใๅ ฌ้ใใใใผใฏใณๅๅจๆกๅผตใขใใญใผใใฎ่ฉณ็ดฐใซๆ่ฌใใพใใใใใฏ็งใใกใฎใใผใฏใณๅๅจใฎๅบ็บ็นใจใใฆไฝฟ็จใใใพใใใ
ใใกใใใMistral AIใซใใๅผทๅใชใใผในใขใใซใฎใชใชใผในใซๆ่ฌใใพใ๏ผ
- Downloads last month
- 595
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit
Model tree for QuantFactory/shisa-7b-v1-GGUF
Base model
augmxnt/shisa-base-7b-v1
