Instructions to use Tanhim/gpt2-model-de with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Tanhim/gpt2-model-de with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Tanhim/gpt2-model-de")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Tanhim/gpt2-model-de") model = AutoModelForCausalLM.from_pretrained("Tanhim/gpt2-model-de", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Tanhim/gpt2-model-de with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Tanhim/gpt2-model-de" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Tanhim/gpt2-model-de", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Tanhim/gpt2-model-de
- SGLang
How to use Tanhim/gpt2-model-de 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 "Tanhim/gpt2-model-de" \ --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": "Tanhim/gpt2-model-de", "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 "Tanhim/gpt2-model-de" \ --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": "Tanhim/gpt2-model-de", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Tanhim/gpt2-model-de with Docker Model Runner:
docker model run hf.co/Tanhim/gpt2-model-de
Commit History
-
Adding `safetensors` variant of this model
This 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.9a99ba9
-
Update README.md
5177423
-
Update README.md
304e3cf
-
Update README.md
9c96963 -
Update README.md
338b738
-
Automatic correction of README.md metadata. Contact website@huggingface.co for any question
f96b90b
-
Update README.md
9607c43
-
Update README.md
6890346 -
Update README.md
4590a6d -
Update README.md
2a8831b -
Update README.md
add2820
-
Update README.md
0f0e4b2
-
update
65ac2b6 -
update
46e943b -
update
ab364bb
-
Update README.md
dcacb10
-
Update README.md
75d3fc0
-
Update README.md
da2363f
-
Update README.md
1c23a6a -
Update README.md
45f1236 -
Update
e58f8ee -
Update README.md
5517e7a -
Update README.md
c249720 -
Update README.md
2f79404 -
Update README.md
190151e -
Update README.md
2c742c2 -
Update README.md
e6b3e3d -
Update
a2d30bd -
Create vocab.json
d5b5db4 -
Create tokenizer_config.json
9206070 -
Update config.json
d3bffaf -
Update
fb8b6f1 -
Update
2e25e85 -
initial commit
e09d8cc