Text Generation
Transformers
PyTorch
TensorFlow
JAX
Safetensors
Dutch
gpt2
adaption
recycled
gpt2-medium
text-generation-inference
Run this model with HF Jobs
Run GroNLP/gpt2-medium-dutch-embeddings on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/GroNLP/gpt2-medium-dutch-embeddings. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/GroNLP/gpt2-medium-dutch-embeddings on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/GroNLP/gpt2-medium-dutch-embeddings. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/GroNLP/gpt2-medium-dutch-embeddings. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use GroNLP/gpt2-medium-dutch-embeddings with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GroNLP/gpt2-medium-dutch-embeddings with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="GroNLP/gpt2-medium-dutch-embeddings")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("GroNLP/gpt2-medium-dutch-embeddings") model = AutoModelForCausalLM.from_pretrained("GroNLP/gpt2-medium-dutch-embeddings", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use GroNLP/gpt2-medium-dutch-embeddings with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "GroNLP/gpt2-medium-dutch-embeddings" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GroNLP/gpt2-medium-dutch-embeddings", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/GroNLP/gpt2-medium-dutch-embeddings
- SGLang
How to use GroNLP/gpt2-medium-dutch-embeddings 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 "GroNLP/gpt2-medium-dutch-embeddings" \ --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": "GroNLP/gpt2-medium-dutch-embeddings", "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 "GroNLP/gpt2-medium-dutch-embeddings" \ --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": "GroNLP/gpt2-medium-dutch-embeddings", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use GroNLP/gpt2-medium-dutch-embeddings with Docker Model Runner:
docker model run hf.co/GroNLP/gpt2-medium-dutch-embeddings
add model files
Browse filesFiles changed (9)
- README.mdAdded+55
- config.jsonAdded+44
- merges.txtAdded
- pytorch_model.binAdded+3
- special_tokens_map.jsonAdded+1
- tf_model.h5Added+3
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+6
- vocab.jsonAdded
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455---language: nltags:- adaption- recycled- gpt2-mediumpipeline_tag: text-generation---
# GPT-2 recycled for Dutch (medium, adapted lexical embeddings)[Wietse de Vries](https://www.semanticscholar.org/author/Wietse-de-Vries/144611157) •[Malvina Nissim](https://www.semanticscholar.org/author/M.-Nissim/2742475)
## Model description
This model is based on the medium OpenAI GPT-2 ([`gpt2-medium`](https://huggingface.co/gpt2-medium)) model.
The Transformer layer weights in this model are identical to the original English, model but the lexical layer has been retrained for a Dutch vocabulary.
For details, check out our paper on [arXiv](https://arxiv.org/abs/XXXX.XXXXX) and the code on [Github](https://github.com/wietsedv/gpt2-recycle).
## Related models
### Dutch - [`gpt2-small-dutch-embeddings`](https://huggingface.co/GroNLP/gpt2-small-dutch): Small model size with only retrained lexical embeddings. - [`gpt2-small-dutch`](https://huggingface.co/GroNLP/gpt2-small-dutch): Small model size with retrained lexical embeddings and additional fine-tuning of the full model. (**Recommended**) - [`gpt2-medium-dutch-embeddings`](https://huggingface.co/GroNLP/gpt2-medium-dutch-embeddings): Medium model size with only retrained lexical embeddings.
### Italian - [`gpt2-small-italian-embeddings`](https://huggingface.co/GroNLP/gpt2-small-italian-embeddings): Small model size with only retrained lexical embeddings. - [`gpt2-small-italian`](https://huggingface.co/GroNLP/gpt2-small-italian): Small model size with retrained lexical embeddings and additional fine-tuning of the full model. (**Recommended**) - [`gpt2-medium-italian-embeddings`](https://huggingface.co/GroNLP/gpt2-medium-italian-embeddings): Medium model size with only retrained lexical embeddings.
## How to use
```pythonfrom transformers import pipeline
pipe = pipeline("text-generation", model="GroNLP/gpt2-medium-dutch-embeddings")```
```pythonfrom transformers import AutoTokenizer, AutoModel, TFAutoModel
tokenizer = AutoTokenizer.from_pretrained("GroNLP/gpt2-medium-dutch-embeddings")model = AutoModel.from_pretrained("GroNLP/gpt2-medium-dutch-embeddings") # PyTorchmodel = TFAutoModel.from_pretrained("GroNLP/gpt2-medium-dutch-embeddings") # Tensorflow```
## BibTeX entry
```bibtex```1234567891011121314151617181920212223242526272829303132333435363738394041424344{ "_name_or_path": "data/hf/gpt2-medium-dutch-embeddings", "activation_function": "gelu_new", "architectures": [ "GPT2LMHeadModel" ], "attn_pdrop": 0.1, "bos_token_id": 1, "embd_pdrop": 0.1, "eos_token_id": 2, "gradient_checkpointing": false, "initializer_range": 0.02, "layer_norm_epsilon": 1e-05, "model_type": "gpt2", "n_ctx": 1024, "n_embd": 1024, "n_head": 16, "n_inner": null, "n_layer": 24, "n_positions": 1024, "n_special": 0, "pad_token_id": 0, "predict_special_tokens": true, "resid_pdrop": 0.1, "summary_activation": null, "summary_first_dropout": 0.1, "summary_proj_to_labels": true, "summary_type": "cls_index", "summary_use_proj": true, "task_specific_params": { "text-generation": { "do_sample": true, "max_length": 100, "no_repeat_ngram_size": 4, "num_beams": 10, "repetition_penalty": 10.0, "temperature": 2.0, "top_k": 20, "top_p": 0.9 } }, "use_cache": true, "vocab_size": 40000}123version https://git-lfs.github.com/spec/v1oid sha256:51399e3320de5bf25ba7a541182c8f4f3f579df08ad23e626f5a5dfbb18a6b69size 14025679791{"bos_token": "<s>", "eos_token": "</s>", "unk_token": "<unk>"}123version https://git-lfs.github.com/spec/v1oid sha256:a311975956e6d86735f2281c4d604306c8e10b12cb7046ca02726c58df3b42f1size 1377613384123456{ "unk_token": "<unk>", "bos_token": "<s>", "eos_token": "</s>", "add_prefix_space": false}README.mdAdded+55
config.jsonAdded+44
merges.txtAdded
pytorch_model.binAdded+3
special_tokens_map.jsonAdded+1
tf_model.h5Added+3
tokenizer.jsonAdded
tokenizer_config.jsonAdded+6
vocab.jsonAdded