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")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ai-forever/mGPT") model = AutoModelForCausalLM.from_pretrained("ai-forever/mGPT") - 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
Update README.md
#5
by typowy-93 - opened
README.md
CHANGED
|
@@ -62,7 +62,6 @@ language:
|
|
| 62 |
- et
|
| 63 |
- fi
|
| 64 |
- hu
|
| 65 |
-
|
| 66 |
pipeline_tag: text-generation
|
| 67 |
tags:
|
| 68 |
- multilingual
|
|
@@ -75,7 +74,7 @@ tags:
|
|
| 75 |
datasets:
|
| 76 |
- mc4
|
| 77 |
- wikipedia
|
| 78 |
-
thumbnail:
|
| 79 |
---
|
| 80 |
|
| 81 |
# Multilingual GPT model
|
|
@@ -140,4 +139,4 @@ Languages:
|
|
| 140 |
## Details
|
| 141 |
The 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 61 languages. The model has seen 440 billion BPE tokens in total.
|
| 142 |
|
| 143 |
-
Total training time was around 14 days on 256 Nvidia V100 GPUs.
|
|
|
|
| 62 |
- et
|
| 63 |
- fi
|
| 64 |
- hu
|
|
|
|
| 65 |
pipeline_tag: text-generation
|
| 66 |
tags:
|
| 67 |
- multilingual
|
|
|
|
| 74 |
datasets:
|
| 75 |
- mc4
|
| 76 |
- wikipedia
|
| 77 |
+
thumbnail: https://github.com/sberbank-ai/mgpt
|
| 78 |
---
|
| 79 |
|
| 80 |
# Multilingual GPT model
|
|
|
|
| 139 |
## Details
|
| 140 |
The 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 61 languages. The model has seen 440 billion BPE tokens in total.
|
| 141 |
|
| 142 |
+
Total training time was around 14 days on 256 Nvidia V100 GPUs.
|