Text Generation
Transformers
PyTorch
TensorFlow
JAX
LiteRT
Rust
English
gpt2
exbert
text-generation-inference
Instructions to use baffo32/gpt2-ptmap with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use baffo32/gpt2-ptmap with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="baffo32/gpt2-ptmap")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("baffo32/gpt2-ptmap") model = AutoModelForCausalLM.from_pretrained("baffo32/gpt2-ptmap", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use baffo32/gpt2-ptmap with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "baffo32/gpt2-ptmap" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "baffo32/gpt2-ptmap", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/baffo32/gpt2-ptmap
- SGLang
How to use baffo32/gpt2-ptmap 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 "baffo32/gpt2-ptmap" \ --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": "baffo32/gpt2-ptmap", "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 "baffo32/gpt2-ptmap" \ --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": "baffo32/gpt2-ptmap", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use baffo32/gpt2-ptmap with Docker Model Runner:
docker model run hf.co/baffo32/gpt2-ptmap
Commit History
-
Adding `safetensors` variant of this model
Verified signatureThis is an automated PR created with https://huggingface.co/spaces/safetensors/convert This new file is equivalent to `pytorch_model.bin` but safe in the sense that no arbitrary code can be put into it. These files also happen to load much faster than their pytorch counterpart: https://colab.research.google.com/github/huggingface/notebooks/blob/main/safetensors_doc/en/speed.ipynb The widgets on your model page will run using this model even if this is not merged making sure the file actually works. If you find any issues: please report here: https://huggingface.co/spaces/safetensors/convert/discussions Feel free to ignore this PR.dcef5ff
-
sorted and packed ptmap
xloeme1509c6 -
normalize gitattributes format
xloeme961453
-
Merge branch 'main' of https://huggingface.co/baffo32/gpt2-ptmap
525534e -
add ptmap model file
06e38f8
-
initial commit
27345ea
-
add gpt2
6c0e608 -
Update .gitattributes
aff9832
-
Migrate model card from transformers-repo
Read announcement at https://discuss.huggingface.co/t/announcement-all-model-cards-will-be-migrated-to-hf-co-model-repos/2755 Original file history: https://github.com/huggingface/transformers/commits/master/model_cards/gpt2-README.md6a8c602
-
For clarity, delete deprecated modelcard.json
We now use the README.md model card instead Approved-by: Julien Chaumond <julien@huggingface.co>84d42a0
-
Update tokenizer.json
210ab4c
-
Update config.json
7979bb7
-
Update rust_model.ot
ee92bbb -
Update config.json
26b7c7a
-
Update config.json
8bfcadd
-
Update modelcard.json
99dd285
-
Update 64-8bits.tflite
8faa6d7 -
Update 64-fp16.tflite
5d494dc
-
Update 64.tflite
b57efa2
-
Update tf_model.h5
ddceb78
-
Update config.json
703af34 -
Update vocab.json
9228726 -
Update merges.txt
a9eff68 -
Update pytorch_model.bin
a49587d -
initial commit
9b865ef