Instructions to use jonomon/gpt3-kor-small_based_on_gpt2_core_ml with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jonomon/gpt3-kor-small_based_on_gpt2_core_ml with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jonomon/gpt3-kor-small_based_on_gpt2_core_ml")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("jonomon/gpt3-kor-small_based_on_gpt2_core_ml") model = AutoModelForMultimodalLM.from_pretrained("jonomon/gpt3-kor-small_based_on_gpt2_core_ml") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use jonomon/gpt3-kor-small_based_on_gpt2_core_ml with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jonomon/gpt3-kor-small_based_on_gpt2_core_ml" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jonomon/gpt3-kor-small_based_on_gpt2_core_ml", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/jonomon/gpt3-kor-small_based_on_gpt2_core_ml
- SGLang
How to use jonomon/gpt3-kor-small_based_on_gpt2_core_ml 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 "jonomon/gpt3-kor-small_based_on_gpt2_core_ml" \ --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": "jonomon/gpt3-kor-small_based_on_gpt2_core_ml", "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 "jonomon/gpt3-kor-small_based_on_gpt2_core_ml" \ --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": "jonomon/gpt3-kor-small_based_on_gpt2_core_ml", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use jonomon/gpt3-kor-small_based_on_gpt2_core_ml with Docker Model Runner:
docker model run hf.co/jonomon/gpt3-kor-small_based_on_gpt2_core_ml
Bert base model for Korean
- 70GB Korean text dataset and 42000 lower-cased subwords are used
- Check the model performance and other language models for Korean in github
from transformers import BertTokenizerFast, GPT2LMHeadModel
tokenizer_gpt3 = BertTokenizerFast.from_pretrained("kykim/gpt3-kor-small_based_on_gpt2")
input_ids = tokenizer_gpt3.encode("text to tokenize")[1:] # remove cls token
model_gpt3 = GPT2LMHeadModel.from_pretrained("kykim/gpt3-kor-small_based_on_gpt2")
- Downloads last month
- 5