gpt-oss-20b
Collection
gpt-oss-20b pre-trained model by midorin-Linux • 4 items • Updated
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("midorin-Linux/gpt-oss-20b-Coding-Distill")
model = AutoModelForCausalLM.from_pretrained("midorin-Linux/gpt-oss-20b-Coding-Distill")
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]:]))This project uses Unsloth for fine-tuning. All training data is converted to OpenAI Harmony format before training, but there may be cases where the output format doesn't conform to the OpenAI Harmony specification.
You can download pre-trained data from HuggingFace.
Safetensors repo: midorin-Linux/gpt-oss-20b-Coding-Distill
GGUF repo: midorin-Linux/gpt-oss-20b-Coding-Distill-GGUF
This project implements a sophisticated multi-phase fine-tuning pipeline for the GPT-OSS-20B model, leveraging conversation data from multiple state-of-the-art AI models to create a balanced, high-performance language model optimized for:
Why This Approach? Traditional fine-tuning often suffers from:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="midorin-Linux/gpt-oss-20b-Coding-Distill") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)