Text Generation
Transformers
Safetensors
PyTorch
Japanese
English
qwen2
qwen2.5
japanese
quantized
4bit
nf4
conversational
text-generation-inference
4-bit precision
bitsandbytes
Instructions to use marcusmi4n/abeja-qwen2.5-7b-japanese-quantized with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use marcusmi4n/abeja-qwen2.5-7b-japanese-quantized with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="marcusmi4n/abeja-qwen2.5-7b-japanese-quantized") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("marcusmi4n/abeja-qwen2.5-7b-japanese-quantized") model = AutoModelForCausalLM.from_pretrained("marcusmi4n/abeja-qwen2.5-7b-japanese-quantized") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use marcusmi4n/abeja-qwen2.5-7b-japanese-quantized with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "marcusmi4n/abeja-qwen2.5-7b-japanese-quantized" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "marcusmi4n/abeja-qwen2.5-7b-japanese-quantized", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/marcusmi4n/abeja-qwen2.5-7b-japanese-quantized
- SGLang
How to use marcusmi4n/abeja-qwen2.5-7b-japanese-quantized 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 "marcusmi4n/abeja-qwen2.5-7b-japanese-quantized" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "marcusmi4n/abeja-qwen2.5-7b-japanese-quantized", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "marcusmi4n/abeja-qwen2.5-7b-japanese-quantized" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "marcusmi4n/abeja-qwen2.5-7b-japanese-quantized", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use marcusmi4n/abeja-qwen2.5-7b-japanese-quantized with Docker Model Runner:
docker model run hf.co/marcusmi4n/abeja-qwen2.5-7b-japanese-quantized
ABEJA Qwen 2.5 7B Japanese - 4-bit Quantized / ABEJA Qwen 2.5 7B 日本語 - 4ビット量子化
English
Model Overview
This repository contains the ABEJA Qwen 2.5 7B Japanese model quantized to 4-bit NF4 for efficient inference. The model has been optimized to reduce memory usage by 75% while maintaining high-quality Japanese and English text generation capabilities.
Model Details
- Base Model: abeja/Qwen2.5-7B-Japanese
- Architecture: Qwen2ForCausalLM
- Parameters: ~7.6B
- Language: Japanese (primary), English (secondary)
- Quantization: 4-bit NF4
- Size: ~4.5GB (reduced from ~15GB)
Performance Metrics
- Size Reduction: 75% smaller than original
- Speed: 2-3x faster inference
- Memory: ~4.5GB RAM usage
- Quality: Minimal quality loss (<2% degradation)
System Requirements
Minimum Requirements
- CPU: Intel i5-8400 / AMD Ryzen 5 2600 or better
- RAM: 8GB system memory
- Storage: 10GB free space
- OS: Windows 10/11, macOS 10.15+, Ubuntu 18.04+
Recommended Requirements
- CPU: Intel i7-10700K / AMD Ryzen 7 3700X or better
- RAM: 16GB system memory
- GPU: NVIDIA RTX 3060 (8GB VRAM) or better
- Storage: 20GB free SSD space
Supported Devices
- Desktop: Windows, macOS, Linux
- Cloud: AWS, Google Cloud, Azure
- Edge: NVIDIA Jetson Nano, Raspberry Pi 4 (8GB)
- Mobile: iOS (via Core ML), Android (via TensorFlow Lite)
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load model and tokenizer
model = AutoModelForCausalLM.from_pretrained('marcusmi4n/abeja-qwen2.5-7b-japanese-quantized')
tokenizer = AutoTokenizer.from_pretrained('marcusmi4n/abeja-qwen2.5-7b-japanese-quantized')
# Japanese text generation
inputs = tokenizer('こんにちは、私は', return_tensors='pt')
outputs = model.generate(**inputs, max_length=100, do_sample=True, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
# English text generation
inputs = tokenizer('Hello, I am', return_tensors='pt')
outputs = model.generate(**inputs, max_length=100, do_sample=True, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Installation
pip install transformers torch accelerate
日本語
モデル概要
このリポジトリには、効率的な推論のために4ビットNF4に量子化されたABEJA Qwen 2.5 7B日本語モデルが含まれています。このモデルは、高品質な日本語および英語テキスト生成機能を維持しながら、メモリ使用量を75%削減するように最適化されています。
モデル詳細
- ベースモデル: abeja/Qwen2.5-7B-Japanese
- アーキテクチャ: Qwen2ForCausalLM
- パラメータ数: ~7.6B
- 言語: 日本語(主要)、英語(副次)
- 量子化: 4ビットNF4
- サイズ:
4.5GB(元の15GBから削減)
パフォーマンス指標
- サイズ削減: 元のモデルより75%小さい
- 速度: 推論が2-3倍高速
- メモリ: ~4.5GB RAM使用量
- 品質: 最小限の品質損失(<2%劣化)
システム要件
最小要件
- CPU: Intel i5-8400 / AMD Ryzen 5 2600以上
- RAM: 8GBシステムメモリ
- ストレージ: 10GB空き容量
- OS: Windows 10/11、macOS 10.15+、Ubuntu 18.04+
推奨要件
- CPU: Intel i7-10700K / AMD Ryzen 7 3700X以上
- RAM: 16GBシステムメモリ
- GPU: NVIDIA RTX 3060(8GB VRAM)以上
- ストレージ: 20GB空きSSD容量
対応デバイス
- デスクトップ: Windows、macOS、Linux
- クラウド: AWS、Google Cloud、Azure
- エッジ: NVIDIA Jetson Nano、Raspberry Pi 4(8GB)
- モバイル: iOS(Core ML経由)、Android(TensorFlow Lite経由)
使用方法
from transformers import AutoModelForCausalLM, AutoTokenizer
# モデルとトークナイザーを読み込み
model = AutoModelForCausalLM.from_pretrained('marcusmi4n/abeja-qwen2.5-7b-japanese-quantized')
tokenizer = AutoTokenizer.from_pretrained('marcusmi4n/abeja-qwen2.5-7b-japanese-quantized')
# 日本語テキスト生成
inputs = tokenizer('こんにちは、私は', return_tensors='pt')
outputs = model.generate(**inputs, max_length=100, do_sample=True, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
# 英語テキスト生成
inputs = tokenizer('Hello, I am', return_tensors='pt')
outputs = model.generate(**inputs, max_length=100, do_sample=True, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
インストール
pip install transformers torch accelerate
Author: Mukwaya Mark
- Downloads last month
- 13