Text Generation
Transformers
PyTorch
TensorFlow
JAX
TensorBoard
Safetensors
Arabic
gpt2
text-generation-inference
Instructions to use aubmindlab/aragpt2-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aubmindlab/aragpt2-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="aubmindlab/aragpt2-base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("aubmindlab/aragpt2-base") model = AutoModelForCausalLM.from_pretrained("aubmindlab/aragpt2-base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use aubmindlab/aragpt2-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aubmindlab/aragpt2-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aubmindlab/aragpt2-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/aubmindlab/aragpt2-base
- SGLang
How to use aubmindlab/aragpt2-base 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 "aubmindlab/aragpt2-base" \ --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": "aubmindlab/aragpt2-base", "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 "aubmindlab/aragpt2-base" \ --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": "aubmindlab/aragpt2-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use aubmindlab/aragpt2-base with Docker Model Runner:
docker model run hf.co/aubmindlab/aragpt2-base
Commit ·
e5f5983
1
Parent(s): 3e0a6d8
added tensorboard logs
Browse filesFiles changed (5)
6 unmodified lines7896 unmodified lines*.ot filter=lfs diff=lfs merge=lfs -text*.onnx filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -text6 unmodified lines789106 unmodified lines*.ot filter=lfs diff=lfs merge=lfs -text*.onnx filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -textevents.out.tfevents* filter=lfs diff=lfs merge=lfs -text
123version https://git-lfs.github.com/spec/v1oid sha256:05df33f0f7f994117e51ab6c93e2a8c4d44eff592b66eb51bc7346dcfd4f3d04size 15184871234bpc = 5.7945323global_step = 125000loss = 4.016464perplexity = 55.811718123version https://git-lfs.github.com/spec/v1oid sha256:d03e76d31189a26ebb8b983195ce34c122e1622ab40c088b66e861f56899289csize 31126434123version https://git-lfs.github.com/spec/v1oid sha256:5780dee6fd14537dbaa204a030934932da8f9b5caea44d33307b72799360d237size 31124470.gitattributes+1
runs/eval/events.out.tfevents.1608681654.tpu-motherAdded+3
runs/eval_results.txtAdded+4
runs/events.out.tfevents.1608138983.tpu-motherAdded+3
runs/events.out.tfevents.1608227376.tpu-motherAdded+3