Instructions to use A2/kogpt2-taf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use A2/kogpt2-taf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="A2/kogpt2-taf")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("A2/kogpt2-taf") model = AutoModelForCausalLM.from_pretrained("A2/kogpt2-taf", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use A2/kogpt2-taf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "A2/kogpt2-taf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "A2/kogpt2-taf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/A2/kogpt2-taf
- SGLang
How to use A2/kogpt2-taf 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 "A2/kogpt2-taf" \ --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": "A2/kogpt2-taf", "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 "A2/kogpt2-taf" \ --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": "A2/kogpt2-taf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use A2/kogpt2-taf with Docker Model Runner:
docker model run hf.co/A2/kogpt2-taf
Commit History
-
daily update for editorial_2022.05.12. 06:00:00
a4a74a7
-
daily update for editorial_2022.05.11. 06:00:00
a818ba0
-
daily update for editorial_2022.05.10. 06:00:00
8f41137
-
daily update for editorial_2022.05.09. 06:00:00
a9ceaff
-
daily update for editorial_2022.05.06. 06:00:00
4012a01 -
daily update for editorial_2022.05.05.
16b3019 -
Update config.json
2de1464 -
Update README.md
c60b8ca -
daily update for editorial
0f7569d
-
Update README.md
1c5f645 -
Update tokenizer_config.json
652d06e -
Update config.json
6bdf51a -
add model_editorial-trained_5e5
2f170af -
add tokenizer
e0bb795 -
initial commit
0fbd301