UICHEOL-HWANG/fairy_dataset
Viewer • Updated • 1.82k • 37
How to use UICHEOL-HWANG/KoGPT2-fairytail with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="UICHEOL-HWANG/KoGPT2-fairytail") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("UICHEOL-HWANG/KoGPT2-fairytail")
model = AutoModelForCausalLM.from_pretrained("UICHEOL-HWANG/KoGPT2-fairytail", device_map="auto")How to use UICHEOL-HWANG/KoGPT2-fairytail with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "UICHEOL-HWANG/KoGPT2-fairytail"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "UICHEOL-HWANG/KoGPT2-fairytail",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/UICHEOL-HWANG/KoGPT2-fairytail
How to use UICHEOL-HWANG/KoGPT2-fairytail with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "UICHEOL-HWANG/KoGPT2-fairytail" \
--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": "UICHEOL-HWANG/KoGPT2-fairytail",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "UICHEOL-HWANG/KoGPT2-fairytail" \
--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": "UICHEOL-HWANG/KoGPT2-fairytail",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use UICHEOL-HWANG/KoGPT2-fairytail with Docker Model Runner:
docker model run hf.co/UICHEOL-HWANG/KoGPT2-fairytail
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("UICHEOL-HWANG/KoGPT2-fairytail")
model = AutoModelForCausalLM.from_pretrained("UICHEOL-HWANG/KoGPT2-fairytail", device_map="auto")동화 데이터 특성상 한 편당 길이가 매우 길어 chunk 단위로 짜른 뒤 데이터를 학습 시킴
그렇게 나눈 덕에 학습 데이터가 매우 많아 VRAM 과부하 발생
frac=0.3 비율로 짤라서 학습github
Base model
skt/kogpt2-base-v2
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="UICHEOL-HWANG/KoGPT2-fairytail")