Instructions to use KoreaTradeNetwork/Qwen-4B-HS4-DPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KoreaTradeNetwork/Qwen-4B-HS4-DPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="KoreaTradeNetwork/Qwen-4B-HS4-DPO") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("KoreaTradeNetwork/Qwen-4B-HS4-DPO") model = AutoModelForCausalLM.from_pretrained("KoreaTradeNetwork/Qwen-4B-HS4-DPO") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use KoreaTradeNetwork/Qwen-4B-HS4-DPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "KoreaTradeNetwork/Qwen-4B-HS4-DPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KoreaTradeNetwork/Qwen-4B-HS4-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/KoreaTradeNetwork/Qwen-4B-HS4-DPO
- SGLang
How to use KoreaTradeNetwork/Qwen-4B-HS4-DPO 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 "KoreaTradeNetwork/Qwen-4B-HS4-DPO" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KoreaTradeNetwork/Qwen-4B-HS4-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "KoreaTradeNetwork/Qwen-4B-HS4-DPO" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KoreaTradeNetwork/Qwen-4B-HS4-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use KoreaTradeNetwork/Qwen-4B-HS4-DPO with Docker Model Runner:
docker model run hf.co/KoreaTradeNetwork/Qwen-4B-HS4-DPO
Model Card: Qwen3-4B-HS4-DPO
์ด ๋ชจ๋ธ์ **ํ๋ช (Item Description)์ผ๋ก๋ถํฐ ๊ด์ธ ํ๋ชฉ ๋ถ๋ฅ ๋ฒํธ(HS Code)**๋ฅผ ์ ํํ๊ฒ ์ถ๋ก ํ๊ธฐ ์ํด Qwen3-4B ๋ชจ๋ธ์ DPO(Direct Preference Optimization) ๋ฐฉ์์ผ๋ก ๋ฏธ์ธ ์กฐ์ (Fine-tuning)ํ ๋ฐ๋ชจ ๋ชจ๋ธ์ ๋๋ค. ํด๋น ๋ชจ๋ธ์ ๋ฐ๋ชจ์ฉ์ผ๋ก ๊ฐ๋ฐ๋์์ผ๋ฉฐ, ์๋์ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ์ฌ ํ์ตํ์ฌ ๊ฒฐ๊ณผ๊ฐ ๋ค์ ๋ถ์ ํํ ์ ์์ต๋๋ค.
1. ๋ชจ๋ธ ์ค๋ช (Model Details)
- Developed by: [AX์ถ์ง์ค]
- Language: ํ๊ตญ์ด, ์์ด
- Model Type: Causal Language Model
- Base Model:
Qwen/Qwen3-4B - Training Method: DPO (Direct Preference Optimization)
- ๋จ์ SFT(Supervised Fine-Tuning)๋ณด๋ค ์ ํํ HS Code ๋งค์นญ ๊ฒฐ๊ณผ๋ฅผ ์ ํธํ๋๋ก ํ์ต๋์์ต๋๋ค.
2. ํ์ต ๋ฐ์ดํฐ ๋ฐ ๋ชฉ์ (Intended Use)
์์ถ์ ํต๊ด ๋ฐ์ดํฐ์ ํ๋ช (Text) ์ ๋ณด์ ์ค์ ํ ๋น๋ HS Code ์์ ํ์ฉํ์์ต๋๋ค.
- Input: ์ํ๋ช ๋๋ ์ํ์ ๋ํ ์์ธ ๋ฌ์ฌ (์: "Wireless Bluetooth Earbuds with Noise Cancelling")
- Output: ํด๋น ์ํ์ HS 4๋จ์ ์ถ๋ก ๊ณผ์ ๋ฐ HS์ฝ๋ 4๋จ์
3. ํ์ต ๊ณผ์ (Training Procedure)
- DPO Pair Data:
- Prompt, Chosen/Rejected Set์ LLM์ผ๋ก ์์ฑํ๊ณ ํ์ต์งํ
- Training Tool: TRL (Transformer Reinforcement Learning)
4. ์ฌ์ฉ ๋ฐฉ๋ฒ (How to use)
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "KoreaTradeNetwork/Qwen3-4B-HS4-DPO"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
prompt = "ํ๋ช
: 'Organic Green Tea Bag'\n์ด ์ํ์ HS ์ฝ๋๋?"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=50)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
- Downloads last month
- 1