heegyu/namuwiki-extracted
Viewer • Updated • 565k • 832 • 25
How to use heegyu/ajoublue-gpt2-medium with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="heegyu/ajoublue-gpt2-medium") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("heegyu/ajoublue-gpt2-medium")
model = AutoModelForCausalLM.from_pretrained("heegyu/ajoublue-gpt2-medium")How to use heegyu/ajoublue-gpt2-medium with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "heegyu/ajoublue-gpt2-medium"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "heegyu/ajoublue-gpt2-medium",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/heegyu/ajoublue-gpt2-medium
How to use heegyu/ajoublue-gpt2-medium with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "heegyu/ajoublue-gpt2-medium" \
--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": "heegyu/ajoublue-gpt2-medium",
"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 "heegyu/ajoublue-gpt2-medium" \
--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": "heegyu/ajoublue-gpt2-medium",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use heegyu/ajoublue-gpt2-medium with Docker Model Runner:
docker model run hf.co/heegyu/ajoublue-gpt2-medium
데이터셋 크기는 전처리한 jsonl파일을 기준으로 함. 총 토큰 수는 약 7B임
from transformers import pipeline
model_name = "heegyu/ajoublue-gpt2-medium"
pipe = pipeline('text-generation', model=model_name)
print(pipe("안녕하세요", repetition_penalty=1.2, do_sample=True, eos_token_id=1, early_stopping=True, max_new_tokens=128))
print(pipe("오늘 정부 발표에 따르면, ", repetition_penalty=1.2, do_sample=True, eos_token_id=1, early_stopping=True, max_new_tokens=128))
print(pipe("싸늘하다. 가슴에 비수가 날아와 꽂힌다. ", repetition_penalty=1.2, do_sample=True, eos_token_id=1, early_stopping=True, max_new_tokens=128, min_length=64))
결과
[{'generated_text': '안녕하세요 라고 말하거나 그 뒤에 뭐~ 어떤 사람이 어~ 그렇게 얘기를 해 놓고 있습니다.\n예?\n그리고 이분이 또 제가 아는 사이인데 이런 말이 있어요. 자기한테 무슨 부탁을 했다고 그러는데 내가 어떻게 하냐면 자기가 인제 술 먹고 한 번 더 술을 먹자 그랬더니 내가 한 번은 잘했지 이렇게 말을 하는 거예요. 그니까 약간 그런 거죠. 그래서 내가 그냥 다른 사람 앞에서 할 말은 하지 말자라는 생각이 들어서 그냥 그렇게 넘어가게 되는 거구요.(웃음) 이제 저 개인적으로는 조금 안타까운 게 이게 뭐냐하면은 어쨌든 저는 원래 남자다 보니까 결혼 생활에 있어서는 정말 안 되려고 해요. 왜냐면 내 자신을 사랑하고 그게 제일 중요한 부분이기 때문에'}]
[{'generated_text': "오늘 정부 발표에 따르면, 對韓 외국인투자가는 지난해 875억달러에서 3년만에 60억달러로 40%가까이 줄어들 것으로 예상됐다. 이런 추세가 지속된다면 올 하반기 중 300달러 이하로 떨어질 확률이 높다.. ◇외국인 주가순자산비율 5년來 최저치=지난해 금융위기로 증시가 폭락한 여파로 국내주식형펀드는 같은 기간 동안 24조7000억원 순유출됐으나 해외 주식형과 채권형은 각각 11조원 이상 늘어났다.(이름) kb국민은행 연구원은 '작년 말 미국의 기준금리 추가 인상과 한 해 뒤 중국 경기회복 기대 등으로 신흥국 중심으로 투자자금이 확대되면서 글로벌 자금의 안전자산 선호"}]
[{'generated_text': '싸늘하다. 가슴에 비수가 날아와 꽂힌다. 苟哭易到之鼓(청야옹도지니)는 명언이라, 이 시를 쓰는 그 마음이 여간 편치 않다 한다"고 하여 이를 "사사로운 일 때문에 시비를 가리기는 힘듭니다만 고인의 말씀처럼 내 한 몸을 지키어 순결하게 살아가고자 합니다."라고 풀이하였다.(『中國書』 「答耕志」에 나온 것으로 \'순결한 삶을 위해\'라는 뜻이다.)\n또한 박인호는 그의 시의 기본 테마를 \'시조를 깊이 있게 탐할 수는 있으나 시로써의 문학성을 논하는 것에는 이르'}]
이 모델의 학습 데이터는 각종 차별/혐오 데이터가 포함됐을 수 있으며, 별도의 제거작업을 진행하지 않았습니다. 따라서 모델이 생성하는 문장에 특정 인물이나 인종, 성별, 장애에 따른 차별/혐오발언을 생성할 수 있습니다.