malhajar/gsm8k-tr
Viewer • Updated • 17.6k • 114 • 9
How to use uisikdag/qwen3-14b-instruct-gsm8k-tr with Transformers:
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("uisikdag/qwen3-14b-instruct-gsm8k-tr", device_map="auto")How to use uisikdag/qwen3-14b-instruct-gsm8k-tr with Unsloth Studio:
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 uisikdag/qwen3-14b-instruct-gsm8k-tr to start chatting
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 uisikdag/qwen3-14b-instruct-gsm8k-tr to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for uisikdag/qwen3-14b-instruct-gsm8k-tr to start chatting
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="uisikdag/qwen3-14b-instruct-gsm8k-tr",
max_seq_length=2048,
)This model is a fine-tuned version of unsloth/Qwen3-14B-unsloth-bnb-4bit. It has been trained using TRL.
import torch
from unsloth import FastLanguageModel
from transformers import TextStreamer
def run_inference():
# Model from finetune_tr_gsm8k_qwen14B.py
model_id = "uisikdag/qwen3-14b-instruct-gsm8k-tr"
print(f"Loading model from Hub: {model_id}")
# Load model and tokenizer from Hub
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = model_id,
max_seq_length = 2048,
load_in_4bit = True,
)
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
# 10 Turkish Math Questions (GSM8K style)
questions = [
"Bir manavda 56 elma vardı. Manav elmaların yarısını sattıktan sonra 12 tanesini daha sattı. Geriye kaç elma kaldı?",
"Ali'nin 5 kitabı var. Ayşe'nin kitap sayısı Ali'ninkinin 3 katından 2 eksik. Ayşe'nin kaç kitabı var?",
"Bir sınıfta 15 kız ve 10 erkek öğrenci var. Sınıftaki toplam öğrenci sayısının 2/5'i gözlüklü. Kaç öğrenci gözlüklü?",
"Bir çiftlikte tavuklar ve inekler var. Toplam baş sayısı 20, toplam ayak sayısı 56 ise kaç inek vardır?",
"3 kalem ve 2 silgi 50 TL. Bir kalem 10 TL ise bir silgi kaç TL'dir?",
"Bir araç saatte 60 km hızla 3 saat gitti. Sonra hızını 80 km'ye çıkarıp 2 saat daha gitti. Toplam kaç km yol aldı?",
"Ahmet bilyelerinin %20'sini Mehmet'e verince elinde 40 bilye kalıyor. Başlangıçta kaç bilyesi vardı?",
"Bir kutuda 5 kırmızı, 4 mavi ve 3 yeşil top var. Rastgele çekilen bir topun kırmızı olma olasılığı nedir?",
"Bir dikdörtgenin kısa kenarı 5 cm, uzun kenarı 12 cm'dir. Bu dikdörtgenin çevresi kaç cm'dir?",
"Babam 45 yaşında. Ben babamın yaşının 1/3'ü kadarım. 5 yıl sonra yaşlarımızın toplamı kaç olur?"
]
print(f"Generating responses for {len(questions)} questions...\n")
for i, question in enumerate(questions, 1):
print(f"--- Question {i} ---")
print(f"User: {question}")
messages = [
{"role" : "user", "content" : question}
]
text = tokenizer.apply_chat_template(
messages,
tokenize = False,
add_generation_prompt = True,
)
_ = model.generate(
**tokenizer(text, return_tensors = "pt").to("cuda"),
max_new_tokens = 512,
temperature = 0.7, top_p = 0.8, top_k = 20,
streamer = TextStreamer(tokenizer, skip_prompt = True),
)
print("\n" + "="*50 + "\n")
if __name__ == "__main__":
run_inference()
This model was trained with SFT.
Cite TRL as:
@misc{vonwerra2022trl,
title = {{TRL: Transformer Reinforcement Learning}},
author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec},
year = 2020,
journal = {GitHub repository},
publisher = {GitHub},
howpublished = {\url{https://github.com/huggingface/trl}}
}
Base model
Qwen/Qwen3-14B-Base