Instructions to use team-lucid/mptk-1b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use team-lucid/mptk-1b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="team-lucid/mptk-1b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("team-lucid/mptk-1b") model = AutoModelForCausalLM.from_pretrained("team-lucid/mptk-1b") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use team-lucid/mptk-1b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "team-lucid/mptk-1b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "team-lucid/mptk-1b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/team-lucid/mptk-1b
- SGLang
How to use team-lucid/mptk-1b 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 "team-lucid/mptk-1b" \ --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": "team-lucid/mptk-1b", "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 "team-lucid/mptk-1b" \ --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": "team-lucid/mptk-1b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use team-lucid/mptk-1b with Docker Model Runner:
docker model run hf.co/team-lucid/mptk-1b
MPTK-1B
MPTK-1B๋ ํ๊ตญ์ด/์์ด์ฝ๋ ๋ฐ์ดํฐ์ ์์ ํ์ต๋ 1.3B ํ๋ผ๋ฏธํฐ์ decoder-only transformer ์ธ์ด๋ชจ๋ธ์ ๋๋ค.
์ด ๋ชจ๋ธ์ ๊ตฌ๊ธ์ TPU Research Cloud(TRC)๋ฅผ ํตํด ์ง์๋ฐ์ Cloud TPU๋ก ํ์ต๋์์ต๋๋ค.
Model Details
Model Description
๋ค๋ฅธ decoder-only transformer์์ ์ผ๋ถ ์์ ๋ ์ํคํ ์ฒ์ธ MPT๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ํฉ๋๋ค.
- ALiBi (Attention with Linear Biases)๋ฅผ ์ฌ์ฉํฉ๋๋ค
- bias๋ฅผ ์ฌ์ฉํ์ง ์์ต๋๋ค.
| Hyperparameter | Value |
|---|---|
| n_parameters | 1.3B |
| n_layers | 24 |
| n_heads | 16 |
| d_model | 2048 |
| vocab size | 50432 |
| sequence length | 2048 |
Uses
How to Get Started with the Model
fp16์ผ๋ก ์คํ ์ NaN์ด ๋ฐ์ํ ์ ์์ต๋๋ค. ๋ฐ๋ผ์ fp32 ํน์ bf16๋ก ์คํํ๊ธฐ๋ฅผ ๊ถ์ฅํฉ๋๋ค.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
tokenizer = AutoTokenizer.from_pretrained("team-lucid/mptk-1b")
model = AutoModelForCausalLM.from_pretrained("team-lucid/mptk-1b")
pipe = pipeline('text-generation', model=model, tokenizer=tokenizer, device='cuda:0')
with torch.autocast('cuda', dtype=torch.bfloat16):
print(
pipe(
'๋ํ๋ฏผ๊ตญ์ ์๋๋',
max_new_tokens=100,
do_sample=True,
)
)
Training Details
Training Data
OSCAR, mC4, wikipedia, namuwiki ๋ฑ ํ๊ตญ์ด ๋ฐ์ดํฐ์ RefinedWeb, The Stack ์์ ์ผ๋ถ๋ฅผ ์ถ๊ฐํด ํ์ตํ์์ต๋๋ค.
Training Hyperparameters
| Hyperparameter | Value |
|---|---|
| Precision | bfloat16 |
| Optimizer | Lion |
| Learning rate | 2e-4 |
| Batch size | 1024 |
- Downloads last month
- 990