Instructions to use mykor/gpt2-ko with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mykor/gpt2-ko with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mykor/gpt2-ko")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mykor/gpt2-ko") model = AutoModelForCausalLM.from_pretrained("mykor/gpt2-ko") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mykor/gpt2-ko with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mykor/gpt2-ko" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mykor/gpt2-ko", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/mykor/gpt2-ko
- SGLang
How to use mykor/gpt2-ko 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 "mykor/gpt2-ko" \ --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": "mykor/gpt2-ko", "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 "mykor/gpt2-ko" \ --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": "mykor/gpt2-ko", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use mykor/gpt2-ko with Docker Model Runner:
docker model run hf.co/mykor/gpt2-ko
gpt2-ko
Korean gpt2 model, trained from scratch.
from transformers import pipeline
pipe = pipeline("text-generation", model="mykor/gpt2-ko")
>>> pipe("오늘 점심 뭐먹지?")
[{'generated_text': '오늘 점심 뭐먹지?치킨과 족발 먹으려고 ㅎ난 치킨먹구싶당 ㅎㅎ나 낼 아침에 먹을겡 ㅎ치킨 먹고시퍼 ㅎㅎ난 치킨에닭도리탕..난 닭도리탕~난 치킨먹었어 ㅎ치킨은 족'}]
>>> pipe("애플은 이번 업데이트를 통해")
[{'generated_text': "애플은 이번 업데이트를 통해 안드로이드 플랫폼 내에서 '모바일 카드'를 판매할 예정'이라며 '기존에는 안드로이드 마켓 내에서만 결제가 가능했다.앞으로는 pc를 통해 결제할 수 있을 것'이라고 덧붙였다.한편, sk텔레콤은 이달 초에도 '갤럭시 s8"}]
- Downloads last month
- 8