Instructions to use benjamin/gerpt2-large with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use benjamin/gerpt2-large with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="benjamin/gerpt2-large")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("benjamin/gerpt2-large") model = AutoModelForCausalLM.from_pretrained("benjamin/gerpt2-large") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use benjamin/gerpt2-large with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "benjamin/gerpt2-large" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "benjamin/gerpt2-large", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/benjamin/gerpt2-large
- SGLang
How to use benjamin/gerpt2-large 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 "benjamin/gerpt2-large" \ --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": "benjamin/gerpt2-large", "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 "benjamin/gerpt2-large" \ --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": "benjamin/gerpt2-large", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use benjamin/gerpt2-large with Docker Model Runner:
docker model run hf.co/benjamin/gerpt2-large
Update README.md
Browse files
README.md
CHANGED
|
@@ -7,7 +7,7 @@ widget:
|
|
| 7 |
license: mit
|
| 8 |
---
|
| 9 |
|
| 10 |
-
# GerPT2
|
| 11 |
|
| 12 |
German large and small versions of GPT2:
|
| 13 |
|
|
@@ -25,6 +25,7 @@ I evaluated both GerPT2-large and the other German GPT2, [dbmdz/german-gpt2](htt
|
|
| 25 |
| dbmdz/german-gpt2 | 49.47 | 62.92 |
|
| 26 |
| GerPT2 | 24.78 | 35.33 |
|
| 27 |
| GerPT2-large | __16.08__ | __23.26__ |
|
|
|
|
| 28 |
|
| 29 |
See the script `evaluate.py` in the [GerPT2 Github repository](https://github.com/bminixhofer/gerpt2) for the code.
|
| 30 |
|
|
@@ -108,7 +109,22 @@ This helps a lot on a trial run I did, although I wasn't able to do a full compa
|
|
| 108 |
|
| 109 |
GerPT2-large is licensed under the MIT License.
|
| 110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
## Acknowledgements
|
| 112 |
|
| 113 |
Thanks to [Hugging Face](https://huggingface.co) for awesome tools and infrastructure.
|
| 114 |
-
Huge thanks to [Artus Krohn-Grimberghe](https://twitter.com/artuskg) at [LYTiQ](https://www.lytiq.de/) for making this possible by sponsoring the resources used for training.
|
|
|
|
| 7 |
license: mit
|
| 8 |
---
|
| 9 |
|
| 10 |
+
# GerPT2
|
| 11 |
|
| 12 |
German large and small versions of GPT2:
|
| 13 |
|
|
|
|
| 25 |
| dbmdz/german-gpt2 | 49.47 | 62.92 |
|
| 26 |
| GerPT2 | 24.78 | 35.33 |
|
| 27 |
| GerPT2-large | __16.08__ | __23.26__ |
|
| 28 |
+
| | | |
|
| 29 |
|
| 30 |
See the script `evaluate.py` in the [GerPT2 Github repository](https://github.com/bminixhofer/gerpt2) for the code.
|
| 31 |
|
|
|
|
| 109 |
|
| 110 |
GerPT2-large is licensed under the MIT License.
|
| 111 |
|
| 112 |
+
## Citing
|
| 113 |
+
|
| 114 |
+
Please cite GerPT2 as follows:
|
| 115 |
+
|
| 116 |
+
```
|
| 117 |
+
@misc{Minixhofer_GerPT2_German_large_2020,
|
| 118 |
+
author = {Minixhofer, Benjamin},
|
| 119 |
+
doi = {10.5281/zenodo.5509984},
|
| 120 |
+
month = {12},
|
| 121 |
+
title = {{GerPT2: German large and small versions of GPT2}},
|
| 122 |
+
url = {https://github.com/bminixhofer/gerpt2},
|
| 123 |
+
year = {2020}
|
| 124 |
+
}
|
| 125 |
+
```
|
| 126 |
+
|
| 127 |
## Acknowledgements
|
| 128 |
|
| 129 |
Thanks to [Hugging Face](https://huggingface.co) for awesome tools and infrastructure.
|
| 130 |
+
Huge thanks to [Artus Krohn-Grimberghe](https://twitter.com/artuskg) at [LYTiQ](https://www.lytiq.de/) for making this possible by sponsoring the resources used for training.
|