Instructions to use tum-nlp/german-gpt2_easy with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tum-nlp/german-gpt2_easy with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tum-nlp/german-gpt2_easy")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tum-nlp/german-gpt2_easy") model = AutoModelForCausalLM.from_pretrained("tum-nlp/german-gpt2_easy") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use tum-nlp/german-gpt2_easy with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tum-nlp/german-gpt2_easy" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tum-nlp/german-gpt2_easy", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tum-nlp/german-gpt2_easy
- SGLang
How to use tum-nlp/german-gpt2_easy 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 "tum-nlp/german-gpt2_easy" \ --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": "tum-nlp/german-gpt2_easy", "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 "tum-nlp/german-gpt2_easy" \ --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": "tum-nlp/german-gpt2_easy", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use tum-nlp/german-gpt2_easy with Docker Model Runner:
docker model run hf.co/tum-nlp/german-gpt2_easy
GPT2 model for German Leichte Sprache (Easy language)
A German Leichte Sprache (Easy language) model based on german-gpt2.
See our code here: https://github.com/MiriUll/Language-Models-German-Simplification
See our paper here: Language Models for German Text Simplification: Overcoming Parallel Data Scarcity through Style-specific Pre-training
Dataset
This model was fine-tuned on a collection of monolingual Leichte Sprache data. This corpus can be recreated here.
Citation
If you use this model, please cite our paper:
@inproceedings{anschutz-etal-2023-language,
β title = "Language Models for {G}erman Text Simplification: Overcoming Parallel Data Scarcity through Style-specific Pre-training",
β author = {Ansch{"u}tz, Miriam and Oehms, Joshua and Wimmer, Thomas and Jezierski, Bart{\l}omiej and Groh, Georg},
β booktitle = "Findings of the Association for Computational Linguistics: ACL 2023",
β month = jul,
β year = "2023",
β address = "Toronto, Canada",
β publisher = "Association for Computational Linguistics",
β url = "https://aclanthology.org/2023.findings-acl.74",
β pages = "1147--1158",
}
- Downloads last month
- 9