Sejong-Qwen-v5_inference.ipynb:
Usage:
!pip install transformers einops accelerate
!pip install qwen
!pip install unsloth
from transformers import AutoTokenizer, AutoModelForCausalLM
# ν ν¬λμ΄μ μ λͺ¨λΈ λ‘λ
tokenizer = AutoTokenizer.from_pretrained(
"SejongKRX/Sejong-Qwen-v5",
trust_remote_code=True,
use_fast=False
)
model = AutoModelForCausalLM.from_pretrained(
"SejongKRX/Sejong-Qwen-v5",
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
λ³Έ λͺ¨λΈμ λ€μν μΆμ²μ λ°μ΄ν°(Wikipedia λ° νκ΅μνμ 곡곡 λ°μ΄ν°)λ₯Ό νμ©νμ¬ νμ΅λμμΌλ©°, λͺ¨λ λ°μ΄ν°λ μ μκΆ λ° μ¬μ© μ μ± μ λ°λΌ μ μ ν μ¬μ©λμμ΅λλ€.
- Wikipedia λ°μ΄ν°λ CC BY-SA 4.0 λΌμ΄μ μ€λ₯Ό λ°λ¦ λλ€. μμΈν μ 보λ μ¬κΈ°μμ νμΈν μ μμ΅λλ€.
- νκ΅μνμ λ°μ΄ν°λ νκ΅μνμ μ μκΆ λ³΄νΈλ°©μΉ¨μ λ°λΌ μ¬μ©λμμ΅λλ€.
Uploaded model
- Developed by: SejongKRX
- License: apache-2.0
- Finetuned from model : unsloth/qwen2.5-7b-bnb-4bit
This qwen2 model was trained 2x faster with Unsloth and Huggingface's TRL library.
- Downloads last month
- 12
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social
visibility and check back later, or deploy to Inference Endpoints (dedicated)
instead.