Instructions to use jonfd/gpt2-igc-is with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jonfd/gpt2-igc-is with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jonfd/gpt2-igc-is")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("jonfd/gpt2-igc-is") model = AutoModelForCausalLM.from_pretrained("jonfd/gpt2-igc-is") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use jonfd/gpt2-igc-is with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jonfd/gpt2-igc-is" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jonfd/gpt2-igc-is", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/jonfd/gpt2-igc-is
- SGLang
How to use jonfd/gpt2-igc-is 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 "jonfd/gpt2-igc-is" \ --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": "jonfd/gpt2-igc-is", "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 "jonfd/gpt2-igc-is" \ --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": "jonfd/gpt2-igc-is", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use jonfd/gpt2-igc-is with Docker Model Runner:
docker model run hf.co/jonfd/gpt2-igc-is
Icelandic GPT-2 model
This Icelandic GPT-2 language model was pretrained on the Icelandic Gigaword Corpus (IGC, 2020 version), which contains approximately 1.532 million running words. The model was trained for 20 epochs on a TPU v3-8, with a total training time of 3 days and 21 hours. The hyperparameters used for training can be found in the JAX/Flax documentation for the Transformers library. The model uses a byte-level BPE tokenizer with a vocabulary size of 51,000.
Note: This model was pretrained on a tokenized and sentence-segmentized version of the IGC, which is reflected by the generated text. A new version of this model, trained on a pre-tokenized version of IGC (2022 version), is forthcoming.
Acknowledgments
This research was supported with Cloud TPUs from Google's TPU Research Cloud (TRC).
- Downloads last month
- 5