Text Generation
Transformers
PyTorch
gpt2
multilingual
PyTorch
Transformers
gpt3
Deepspeed
Megatron
text-generation-inference
Instructions to use ai-forever/mGPT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ai-forever/mGPT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ai-forever/mGPT")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ai-forever/mGPT") model = AutoModelForCausalLM.from_pretrained("ai-forever/mGPT", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ai-forever/mGPT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ai-forever/mGPT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ai-forever/mGPT", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ai-forever/mGPT
- SGLang
How to use ai-forever/mGPT 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 "ai-forever/mGPT" \ --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": "ai-forever/mGPT", "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 "ai-forever/mGPT" \ --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": "ai-forever/mGPT", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ai-forever/mGPT with Docker Model Runner:
docker model run hf.co/ai-forever/mGPT
Commit ·
14ac632
1
Parent(s): 80cd3eb
Update README.md
Browse files
README.md
CHANGED
|
@@ -102,13 +102,14 @@ Model includes 60 languages: (iso codes)
|
|
| 102 |
|
| 103 |
## Training Data Statistics
|
| 104 |
|
| 105 |
-
- Tokens:
|
|
|
|
| 106 |
|
| 107 |
<img style="text-align:center; display:block;" src="https://huggingface.co/sberbank-ai/mGPT/resolve/main/stats.png">
|
| 108 |
"General training corpus statistics"
|
| 109 |
|
| 110 |
|
| 111 |
## Details
|
| 112 |
-
Model was trained with sequence length
|
| 113 |
|
| 114 |
-
Total training time was around
|
|
|
|
| 102 |
|
| 103 |
## Training Data Statistics
|
| 104 |
|
| 105 |
+
- Tokens: 488 Billion BBPE tokens
|
| 106 |
+
|
| 107 |
|
| 108 |
<img style="text-align:center; display:block;" src="https://huggingface.co/sberbank-ai/mGPT/resolve/main/stats.png">
|
| 109 |
"General training corpus statistics"
|
| 110 |
|
| 111 |
|
| 112 |
## Details
|
| 113 |
+
Model was trained with sequence length 512 using Megatron and Deepspeed libs by [SberDevices](https://sberdevices.ru/) team on a dataset of 600 GB of texts in 60 languages. The model has seen 440 billion BPE tokens in total.
|
| 114 |
|
| 115 |
+
Total training time was around 12 days on 256 Nvidia V100 GPUs.
|