Sungur-9B is a Turkish-specialized large language model derived from ytu-ce-cosmos/Turkish-Gemma-9b-v0.1, which itself is based on Gemma-2-9b. The model was further trained using a 7k-sample Direct Preference Optimization (DPO) dataset created via translation and fine-tuned with 4-bit QLoRA, refining its alignment with human preferences.
Sungur-9B is designed for Turkish text generation tasks, producing coherent and contextually appropriate outputs. Its training process enables it to deliver fluent, context-aware responses.
1from transformers import pipeline
23pipe = pipeline("text-generation", model="suayptalha/Sungur-9B")45messages =[6{"role":"user","content":"Bana kuantum dolanıklığını çok kısaca anlat."},7]8pipe(messages)[0]["generated_text"][-1]["content"]910#Kuantum dolanıklığı, birbirine bağlı iki parçacığın, ne kadar uzakta olsalar bile, birinin durumunun diğerini anında etkilemesi olarak düşünülebilir.1112#Örneğin, bir parçacık "yukarı" döndüğünde, dolanık olduğu diğer parçacık kesinlikle "aşağı" dönecektir. Bu değişim anında gerçekleşir, ışık hızını aşarak. Fakat bu durum, uzaktaki parçacığın bir "bilgiyi" aldığını göstermez, çünkü ölçüm sonucu zaten önceden belirlenmiştir.1314#Dolanıklık, kuantum dünyasının tuhaf ve ilginç bir özelliğidir ve bilgi teknolojileri (kuantum bilgisayarlar) gibi alanlarda devrim yaratma potansiyeline sahiptir.
AutoModelForCausalLM
py
1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
34model_id ="suayptalha/Sungur-9B"5tokenizer = AutoTokenizer.from_pretrained(model_id)6model = AutoModelForCausalLM.from_pretrained(7 model_id,8 torch_dtype=torch.bfloat16,9 device_map="auto",10)1112messages =[13{"role":"user","content":"5x + 1 = 16. x'i bul."},14]1516inputs = tokenizer.apply_chat_template(17 messages,18 add_generation_prompt=True,19 tokenize=True,20 return_dict=True,21 return_tensors="pt",22).to(model.device)2324outputs = model.generate(25**inputs,26 max_new_tokens=2048,27 do_sample=False,28 eos_token_id=tokenizer.eos_token_id
29)3031output_ids = outputs[0]32input_length = inputs["input_ids"].shape[1]33generated_tokens = output_ids[input_length:]34answer = tokenizer.decode(generated_tokens, skip_special_tokens=True)35print(answer)3637# 5x + 1 = 16 denklemini çözmek için şu adımları izleyelim:3839# 1. **Sabit terimi eşitliğin diğer tarafına taşıyalım:**40# 5x = 16 - 141# 5x = 154243# 2. **x'i yalnız bırakmak için her iki tarafı 5'e bölelim:**44# x = 15 / 545# x = 34647# **Sonuç:** x = 34849# Denklemi kontrol edelim:50# 5 * 3 + 1 = 15 + 1 = 16 (Doğru)
Acknowledgments
Thanks to ytu-ce-cosmos for their amazing Turkish-Gemma-9b-v0.1 model.
Thanks to axolotl for making the repository I used to make this model.