Instructions to use benjamin/gpt2-large-wechsel-ukrainian with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use benjamin/gpt2-large-wechsel-ukrainian with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="benjamin/gpt2-large-wechsel-ukrainian")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("benjamin/gpt2-large-wechsel-ukrainian") model = AutoModelForCausalLM.from_pretrained("benjamin/gpt2-large-wechsel-ukrainian", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use benjamin/gpt2-large-wechsel-ukrainian with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "benjamin/gpt2-large-wechsel-ukrainian" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "benjamin/gpt2-large-wechsel-ukrainian", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/benjamin/gpt2-large-wechsel-ukrainian
- SGLang
How to use benjamin/gpt2-large-wechsel-ukrainian 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/gpt2-large-wechsel-ukrainian" \ --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/gpt2-large-wechsel-ukrainian", "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/gpt2-large-wechsel-ukrainian" \ --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/gpt2-large-wechsel-ukrainian", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use benjamin/gpt2-large-wechsel-ukrainian with Docker Model Runner:
docker model run hf.co/benjamin/gpt2-large-wechsel-ukrainian
Could you please share the training code and information on the dataset you've used to train this one?
I'm keen to try to train more ukrainian models using wechsel on the corpus I recently released: https://aclanthology.org/2023.unlp-1.1/ and other data that I have at my disposal.
That's great!
I just made the code public for you: https://github.com/bminixhofer/ukrainian-wechsel-models
You can find the data and model preparation scripts + configs there. The run_clm.py and run_mlm.py scripts are iirc an unchanged copy of the Huggingface scripts from some time ago.
The training runs are here: https://wandb.ai/bminixhofer/ukrainian-nlp
Hope that helps!
Thanks for the prompt response, reading the source code now.
So glad you've been using lang-uk NER that we've created and open sourced :)
Oh, finally HF is back to normal.