ikedachin/difficult_problem_dataset_v2
Viewer • Updated • 2.75k • 26 • 1
How to use ikedachin/gpt-oss-20b-dp-v2-merged with PEFT:
Task type is invalid.
How to use ikedachin/gpt-oss-20b-dp-v2-merged with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="ikedachin/gpt-oss-20b-dp-v2-merged")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForMultimodalLM
tokenizer = AutoTokenizer.from_pretrained("ikedachin/gpt-oss-20b-dp-v2-merged")
model = AutoModelForMultimodalLM.from_pretrained("ikedachin/gpt-oss-20b-dp-v2-merged")
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]:]))How to use ikedachin/gpt-oss-20b-dp-v2-merged with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "ikedachin/gpt-oss-20b-dp-v2-merged"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "ikedachin/gpt-oss-20b-dp-v2-merged",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/ikedachin/gpt-oss-20b-dp-v2-merged
How to use ikedachin/gpt-oss-20b-dp-v2-merged with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "ikedachin/gpt-oss-20b-dp-v2-merged" \
--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": "ikedachin/gpt-oss-20b-dp-v2-merged",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "ikedachin/gpt-oss-20b-dp-v2-merged" \
--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": "ikedachin/gpt-oss-20b-dp-v2-merged",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use ikedachin/gpt-oss-20b-dp-v2-merged with Docker Model Runner:
docker model run hf.co/ikedachin/gpt-oss-20b-dp-v2-merged
axolotl version: 0.12.2
base_model: openai/gpt-oss-20b
use_kernels: true
quantization_config:
load_in_4bit: true
bnb_4bit_compute_dtype: "bfloat16"
bnb_4bit_quant_type: "nf4"
bnb_4bit_use_double_quant: true
plugins:
- axolotl.integrations.cut_cross_entropy.CutCrossEntropyPlugin
experimental_skip_move_to_device: true
hub_model_id: ikedachin/gpt-oss-20b-dp-v2
hub_strategy: "end"
hf_use_auth_token: true
wandb_project: axolotl
wandb_name: gpt-oss-20b-dp-v2-sft
logging_steps: 5
datasets:
- path: ikedachin/difficult_problem_dataset_v2
split: train
type:
field_instruction: input
field_output: output
format: |
User: {instruction}
Assistant:
no_input_format: |
User: {instruction}
Assistant:
train_on_inputs: false
dataset_prepared_path: last_run_prepared
val_set_size: 0
output_dir: ./outputs/gpt-oss-out-merged/
sequence_len: 8192
sample_packing: true
adapter: lora
lora_r: 8
lora_alpha: 16
lora_dropout: 0.0
lora_target_modules:
- q_proj
- k_proj
- v_proj
- o_proj
- gate_proj
- up_proj
- down_proj
gradient_accumulation_steps: 8
micro_batch_size: 1
num_epochs: 1
optimizer: adamw_torch_8bit
lr_scheduler: cosine
cosine_min_lr_ratio: 0.01
max_grad_norm: 1
learning_rate: 1e-5
bf16: true
tf32: true
flash_attention: true
attn_implementation: kernels-community/vllm-flash-attn3
gradient_checkpointing: true
activation_offloading: true
saves_per_epoch: 1
warmup_ratio: 0.1
special_tokens:
eot_tokens:
- "<|end|>"
merge_adapter: true
save_safetensors: true
This model is a fine-tuned version of openai/gpt-oss-20b on the ikedachin/difficult_problem_dataset_v2 dataset.
This model was fine-tuned using LoRA (Low-Rank Adaptation) and merged with the base model (openai/gpt-oss-20b).
More information needed
Not yet Eval
The following hyperparameters were used during training:
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
model_name = "ikedachin/gpt-oss-20b-dp-v2"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
# 推論パイプラインの作成
generator = pipeline("text-generation", model=model, tokenizer=tokenizer)
# テスト入力
input_text = "1~100の間の素数を見つけるPythonプログラムを作成してください。"
# 推論実行
output = generator(input_text, max_length=100, do_sample=True, temperature=0.7)
# 結果表示
print(output[0]["generated_text"])
Base model
openai/gpt-oss-20b