Instructions to use Aratako/ELYZA-japanese-Llama-2-fast-MoE-2x7B-v0.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Aratako/ELYZA-japanese-Llama-2-fast-MoE-2x7B-v0.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Aratako/ELYZA-japanese-Llama-2-fast-MoE-2x7B-v0.1")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Aratako/ELYZA-japanese-Llama-2-fast-MoE-2x7B-v0.1") model = AutoModelForCausalLM.from_pretrained("Aratako/ELYZA-japanese-Llama-2-fast-MoE-2x7B-v0.1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Aratako/ELYZA-japanese-Llama-2-fast-MoE-2x7B-v0.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Aratako/ELYZA-japanese-Llama-2-fast-MoE-2x7B-v0.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Aratako/ELYZA-japanese-Llama-2-fast-MoE-2x7B-v0.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Aratako/ELYZA-japanese-Llama-2-fast-MoE-2x7B-v0.1
- SGLang
How to use Aratako/ELYZA-japanese-Llama-2-fast-MoE-2x7B-v0.1 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 "Aratako/ELYZA-japanese-Llama-2-fast-MoE-2x7B-v0.1" \ --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": "Aratako/ELYZA-japanese-Llama-2-fast-MoE-2x7B-v0.1", "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 "Aratako/ELYZA-japanese-Llama-2-fast-MoE-2x7B-v0.1" \ --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": "Aratako/ELYZA-japanese-Llama-2-fast-MoE-2x7B-v0.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Aratako/ELYZA-japanese-Llama-2-fast-MoE-2x7B-v0.1 with Docker Model Runner:
docker model run hf.co/Aratako/ELYZA-japanese-Llama-2-fast-MoE-2x7B-v0.1
ELYZA-japanese-Llama-2-fast-MoE-2x7B-v0.1
概要
Llama-2ベースの学習済み日本語モデルであるelyza/ELYZA-japanese-Llama-2-7b-fastと、そのinstruction tuningモデルであるelyza/ELYZA-japanese-Llama-2-7b-fast-instruct を、mergekitを使ってMoEを行い作成したモデルです。
以下2モデルを利用しています。
ライセンス
元モデルの通り、Llama2ライセンスを継承します。
Llama 2 is licensed under the LLAMA 2 Community License, Copyright (c) Meta Platforms, Inc. All Rights Reserved.
ベンチマーク
ベースとしたELYZA-japanese-Llama-2-7b-fast-instructと本モデルのjapanese-mt-benchの結果は以下の通りです。 (シングルターン)
| Model | Size | Coding | Extraction | Humanities | Math | Reasoning | Roleplay | STEM | Writing | avg_score |
|---|---|---|---|---|---|---|---|---|---|---|
| ELYZA-japanese-Llama-2-7b-fast-instruct | 7B | 2.8 | 5.2 | 7.1 | 2.0 | 3.6 | 6.0 | 5.9 | 6.4 | 4.8750 |
| This model | 2x7B | 3.5 | 5.1 | 7.5 | 1.9 | 3.5 | 6.3 | 5.9 | 7.6 | 5.1625 |
ベンチマークに使用したプロンプト
"""<s>[INST] <<SYS>>
あなたは誠実で優秀な日本人のアシスタントです。
<</SYS>>
{instruction} [/INST]"""
Description
This model is created using MoE (Mixture of Experts) through mergekit based on elyza/ELYZA-japanese-Llama-2-7b-fast and elyza/ELYZA-japanese-Llama-2-7b-fast-instruct.
Click here for the GGUF version
It utilizes the following two models:
License
This model inherit the Llama2 license. Llama 2 is licensed under the LLAMA 2 Community License, Copyright (c) Meta Platforms, Inc. All Rights Reserved.
Benchmark
The results of this model and the base ELYZA-japanese-Llama-2-7b-instruct on japanese-mt-bench are as follows. (Single turn)
| Model | Size | Coding | Extraction | Humanities | Math | Reasoning | Roleplay | STEM | Writing | avg_score |
|---|---|---|---|---|---|---|---|---|---|---|
| ELYZA-japanese-Llama-2-7b-fast-instruct | 7B | 2.8 | 5.2 | 7.1 | 2.0 | 3.6 | 6.0 | 5.9 | 6.4 | 4.8750 |
| This model | 2x7B | 3.5 | 5.1 | 7.5 | 1.9 | 3.5 | 6.3 | 5.9 | 7.6 | 5.1625 |
Prompt used for benchmark
"""<s>[INST] <<SYS>>
あなたは誠実で優秀な日本人のアシスタントです。
<</SYS>>
{instruction} [/INST]"""
Merge config
base_model: ./ELYZA-japanese-Llama-2-7b-fast-instruct
gate_mode: random
dtype: bfloat16
experts:
- source_model: ./ELYZA-japanese-Llama-2-7b-fast-instruct
positive_prompts: []
- source_model: ./ELYZA-japanese-Llama-2-7b-fast
positive_prompts: []
tokenizer_source: model:./ELYZA-japanese-Llama-2-7b-fast-instruct
- Downloads last month
- 393
