Instructions to use kotoba-tech/kotomamba-2.8B-v1.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kotoba-tech/kotomamba-2.8B-v1.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kotoba-tech/kotomamba-2.8B-v1.0")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("kotoba-tech/kotomamba-2.8B-v1.0", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use kotoba-tech/kotomamba-2.8B-v1.0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kotoba-tech/kotomamba-2.8B-v1.0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kotoba-tech/kotomamba-2.8B-v1.0", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/kotoba-tech/kotomamba-2.8B-v1.0
- SGLang
How to use kotoba-tech/kotomamba-2.8B-v1.0 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 "kotoba-tech/kotomamba-2.8B-v1.0" \ --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": "kotoba-tech/kotomamba-2.8B-v1.0", "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 "kotoba-tech/kotomamba-2.8B-v1.0" \ --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": "kotoba-tech/kotomamba-2.8B-v1.0", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use kotoba-tech/kotomamba-2.8B-v1.0 with Docker Model Runner:
docker model run hf.co/kotoba-tech/kotomamba-2.8B-v1.0
Configuration Parsing Warning:In config.json: "architectures" must be an array
Configuration Parsing Warning:In config.json: "model_type" is not allowed to be empty
Kotomamba
The kotomamba model represents a cutting-edge approach in natural language processing (NLP), leveraging the innovative State Space Model mamba architecture. The kotomamba model comes in two distinct versions.
- Bilingual Pre-training (Japanese and English): The first variant of the kotomamba model is pre-trained on a rich dataset(About 200B Token) comprising both Japanese and English texts.
- Continual Pre-training (Mainly Japanese): The second variant of the kotomamba model takes a different approach, focusing exclusively on Japanese-centric data for its continual pre-training phase.
Kotomamba Model Index
This repository provides large language models developed by Kotoba Technologies, Tohoku University TohokuNLP group, and Tokyo Institute of Technology Okazaki Lab, Yokota Lab. Read our blog post or our technical paper (preprint coming soon) for more details!
Model Details
- Model type: Please refer to mamba technical paper for details on the model architecture.
- Language(s): Japanese English
- Library: kotomamba
- Tokenizer: kotomamba-2.8B uses llm-jp-tokenizer 100K and kotomamba-2.8B-CL uses GPT-NeoX Tokenizer.
- Contact:
Base Model Performance
Japanese version
| Model | Size | JCommonsenseQA | JEMHopQA | NIILC | JSQuAD |
|---|---|---|---|---|---|
| 4-shot | 4-shot | 4-shot | 4-shot | ||
| state-spaces/mamba-2.8b-slimpj | 2.8B | 0.1796 | 0.2825 | 0.0998 | 0.3301 |
| kotomamba-2.8B | 2.8B | 0.185 | 0.4532 | 0.3871 | 0.4685 |
| kotomamba-2.8B-CL | 2.8B | 0.185 | 0.3758 | 0.2393 | 0.5929 |
Usage
git clone https://github.com/kotoba-tech/kotomamba and follow the repository's README installation section.
WARNING: huggingface transformers AutoModelForCausalLM doesn't support mamba model. So, please use kotomamba/benchmarks/benchmark_generation_mamba_simple.py
You can find the inference sample script in scripts/abci/inference/inference_sample.sh
Training Datasets
Pre-Training & Continual Pre-Training
The following datasets were used for training.
- Japanese Wikipedia
- Swallow Corpus
- SlimPajama
Risks and Limitations
The models released here are still in the early stages of our research and development and have not been tuned to ensure outputs align with human intent and safety considerations.
Acknowledgements
We thank Albert Gu and Tri Dao for releasing the original mamba model and implementation on GitHub.
Our project is supported by the ABCI Grand Challenge of the National Institute of Advanced Industrial Science and Technology.
License
Apache License Version 2.0, January 2004
Authors
Here are the team members:
- From Kotoba Technologies
- From TohokuNLP group at Tohoku University
- From Tokyo Institute of Technologies
- From Okazaki Laboratory, the following members:
- From YOKOTA Laboratory, the following members:
- Downloads last month
- 11
