Instructions to use aixsatoshi/Swallow-MX-8x7b-NVE-chatvector-Mixtral-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aixsatoshi/Swallow-MX-8x7b-NVE-chatvector-Mixtral-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="aixsatoshi/Swallow-MX-8x7b-NVE-chatvector-Mixtral-instruct")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("aixsatoshi/Swallow-MX-8x7b-NVE-chatvector-Mixtral-instruct") model = AutoModelForCausalLM.from_pretrained("aixsatoshi/Swallow-MX-8x7b-NVE-chatvector-Mixtral-instruct", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use aixsatoshi/Swallow-MX-8x7b-NVE-chatvector-Mixtral-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aixsatoshi/Swallow-MX-8x7b-NVE-chatvector-Mixtral-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aixsatoshi/Swallow-MX-8x7b-NVE-chatvector-Mixtral-instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/aixsatoshi/Swallow-MX-8x7b-NVE-chatvector-Mixtral-instruct
- SGLang
How to use aixsatoshi/Swallow-MX-8x7b-NVE-chatvector-Mixtral-instruct 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 "aixsatoshi/Swallow-MX-8x7b-NVE-chatvector-Mixtral-instruct" \ --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": "aixsatoshi/Swallow-MX-8x7b-NVE-chatvector-Mixtral-instruct", "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 "aixsatoshi/Swallow-MX-8x7b-NVE-chatvector-Mixtral-instruct" \ --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": "aixsatoshi/Swallow-MX-8x7b-NVE-chatvector-Mixtral-instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use aixsatoshi/Swallow-MX-8x7b-NVE-chatvector-Mixtral-instruct with Docker Model Runner:
docker model run hf.co/aixsatoshi/Swallow-MX-8x7b-NVE-chatvector-Mixtral-instruct
更新情報
日本語機能とinstructベクトルのバランス調整したver.2をアップロードしました
Swallow-MX-8x7b-NVE-chatvector-Mixtral-instruct-v2
モデル概要
Mixtral-8x7B-Instruct-v0.1と
Mixtral-8x7B-v0.1の差分をマージしたモデルです。
Swallow-MX-8x7b-NVE-v0.1 + Mixtral-8x7B-Instruct-v0.1 - Mixtral-8x7B-v0.1
Swallow-MX-8x7b-NVE-v0.1は、コンテクスト長4096までの日本語継続学習モデルですが、
英語モデルのInstructベクトルをマージすることで、流暢な日本語機能を維持してコンテクスト長を32Kまで拡大、Instruct機能を大幅アップしました。
注目すべき点
1、4096token以上の部分は日本語継続事前学習していないが、今回の英語モデルの差分マージのみで日本語機能が32Kまで維持出来ている点
2、英語モデルのInstruct機能が、差分マージのみで日本語モデルに簡単に移行できる点
詳細は以下文献を参照ください。
参考文献
LLM差分マージしてみた
Chat Vector
Chat Vectorを使って日本語LLMをチャットモデルに改造する
jovyan/Swallow-MS-7b-v0.1-ChatVector
kousw/stablelm-gamma-7b-chatvector
- Downloads last month
- 5