Text Generation
Transformers
PyTorch
Safetensors
English
qwen2
text-generation-inference
unsloth
trl
krx
Instructions to use SejongKRX/Sejong-Qwen-v3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SejongKRX/Sejong-Qwen-v3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SejongKRX/Sejong-Qwen-v3")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SejongKRX/Sejong-Qwen-v3") model = AutoModelForCausalLM.from_pretrained("SejongKRX/Sejong-Qwen-v3") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use SejongKRX/Sejong-Qwen-v3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SejongKRX/Sejong-Qwen-v3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SejongKRX/Sejong-Qwen-v3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/SejongKRX/Sejong-Qwen-v3
- SGLang
How to use SejongKRX/Sejong-Qwen-v3 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 "SejongKRX/Sejong-Qwen-v3" \ --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": "SejongKRX/Sejong-Qwen-v3", "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 "SejongKRX/Sejong-Qwen-v3" \ --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": "SejongKRX/Sejong-Qwen-v3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Studio new
How to use SejongKRX/Sejong-Qwen-v3 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for SejongKRX/Sejong-Qwen-v3 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for SejongKRX/Sejong-Qwen-v3 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for SejongKRX/Sejong-Qwen-v3 to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="SejongKRX/Sejong-Qwen-v3", max_seq_length=2048, ) - Docker Model Runner
How to use SejongKRX/Sejong-Qwen-v3 with Docker Model Runner:
docker model run hf.co/SejongKRX/Sejong-Qwen-v3
Uploaded model
- Developed by: SejongKRX
- License: apache-2.0
- Finetuned from model : SejongKRX/Sejong-Qwen-v1
This qwen2 model was trained 2x faster with Unsloth and Huggingface's TRL library.
Usage:
Sejong-Qwen-v3_inference.ipynb:
!pip install transformers einops accelerate
!pip install qwen
!pip install unsloth
from transformers import AutoTokenizer, AutoModelForCausalLM
# 토크나이저와 모델 로드
tokenizer = AutoTokenizer.from_pretrained(
"SejongKRX/Sejong-Qwen-3",
trust_remote_code=True,
use_fast=False
)
model = AutoModelForCausalLM.from_pretrained(
"SejongKRX/Sejong-Qwen-3",
trust_remote_code=True
)
# 입력 텍스트
input_text = """
다음 중 화폐의 시간가치에 관한 설명으로 옳지 않은 것은 무엇인가?
A. 월 복리의 경우, 매월 적용되는 이자율은 연간 명목 이자율을 1/12로 나누어 산출한다.
B. 투자 원금 및 기타 조건이 동일할 경우, 단리 방식보다 복리 방식에서 발생하는 이자가 더 크다.
C. 일시불로 지급될 금액의 현재 가치는 미래 가치를 일정 기간 동안 할인율을 적용해 산출할 수 있다.
D. 1,000,000원을 연 5% 복리로 2년 동안 예치했을 경우, 만기에 받을 세전 이자는 100,000원이다.
### 정답:
"""
inputs = tokenizer(input_text, return_tensors="pt")
# 모델을 사용하여 텍스트 생성
output = model.generate(**inputs, max_new_tokens=1500)
# 결과 디코딩
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
print(generated_text)
output:
다음 중 화폐의 시간가치에 관한 설명으로 옳지 않은 것은 무엇인가?
A. 월 복리의 경우, 매월 적용되는 이자율은 연간 명목 이자율을 1/12로 나누어 산출한다.
B. 투자 원금 및 기타 조건이 동일할 경우, 단리 방식보다 복리 방식에서 발생하는 이자가 더 크다.
C. 일시불로 지급될 금액의 현재 가치는 미래 가치를 일정 기간 동안 할인율을 적용해 산출할 수 있다.
D. 1,000,000원을 연 5% 복리로 2년 동안 예치했을 경우, 만기에 받을 세전 이자는 100,000원이다.
### 정답:
D
Dataset
본 모델은 다양한 출처의 데이터(mlabonne/open-perfectblend, Wikipedia, 한국은행의 공공 데이터 등)를 활용하여 학습되었으며, 모든 데이터는 저작권 및 사용 정책에 따라 적절히 사용되었습니다.
- Wikipedia 데이터는 CC BY-SA 4.0 라이선스를 따릅니다. 자세한 정보는 여기에서 확인할 수 있습니다.
- 한국은행의 데이터는 한국은행의 저작권 보호방침에 따라 사용되었습니다.
- mlabonne/open-perfectblend 데이터는 Apache 2.0 라이선스를 따릅니다. 라이선스에 대한 자세한 내용은 Apache 2.0 라이선스에서 확인할 수 있습니다.
- Downloads last month
- 3
