Views
No views yet
emre/gemma-7b-it-Turkish-Reasoning-FT-smolunsloth/gemma-7b-it-bnb-4bittr): Primary language for input and output.en): Used in dataset reasoning components.text-generation-inference, transformers, unsloth, gemma, trlemre/finance-reasoning-turkish (Hugging Face dataset)unsloth/gemma-7b-it-bnb-4bit model, adapted for advanced reasoning tasks in Turkish, focusing on finance-related question-answering. It leverages the emre/finance-reasoning-turkish dataset and was trained using efficient techniques to enhance performance on a single A100 GPU.transformers library. Below are instructions for loading the model and generating responses (code snippets provided separately).transformers library (version 4.49.0 recommended)torch library with CUDA support for GPU usageunsloth library (optional, for faster inference if compatible)bitsandbytes.emre/finance-reasoning-turkishadamw_8bit2e-4 (initial), with linear schedulingper_device_train_batch_size=2, gradient_accumulation_steps=4)fp16=True)r): 16lora_alpha): 16lora_dropout): 0["q_proj", "o_proj", "gate_proj", "v_proj", "up_proj", "down_proj", "k_proj"]CAUSAL_LM1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
3
4# Load the tokenizer
5tokenizer = AutoTokenizer.from_pretrained("emre/gemma-7b-it-Turkish-Reasoning-FT-smol")
6
7# Load the model with 4-bit quantization
8model = AutoModelForCausalLM.from_pretrained(
9 "emre/gemma-7b-it-Turkish-Reasoning-FT-smol",
10 torch_dtype=torch.float16,
11 load_in_4bit=True
12)
13
14# Move to GPU if available
15device = "cuda" if torch.cuda.is_available() else "cpu"
16model.to(device)1# Define the input text (example in Turkish)
2input_text = (
3 "<user_question>Bankalar neden yüksek faiz oranları sunuyor?</user_question>\n"
4 "<RAG Content>Bankalar, mevduat toplamak ve krediler için fon sağlamak amacıyla faiz oranlarını "
5 "artırabilir. Yüksek faiz oranları, genellikle ekonomik belirsizlik veya enflasyon dönemlerinde "
6 "görülür. Bu, yatırımcıları çekmek ve likiditeyi artırmak için bir stratejidir.</RAG Content>\n"
7)
8
9# Tokenize the input
10inputs = tokenizer(input_text, return_tensors="pt").to(device)
11
12# Generate response
13with torch.no_grad():
14 outputs = model.generate(
15 **inputs,
16 max_length=500, # Adjust as needed
17 temperature=0.7,
18 top_p=0.9,
19 do_sample=True,
20 num_return_sequences=1
21 )
22
23# Decode and print the response
24response = tokenizer.decode(outputs[0], skip_special_tokens=True)
25print(response)1@misc{emre_gemma_7b_it_turkish_reasoning_ft_smol,
2 author = {Davut Emre Tasar},
3 title = {Gemma-7B-IT Turkish Reasoning FT Smol},
4 year = {2025},
5 publisher = {Hugging Face},
6 howpublished = {\url{https://huggingface.co/emre/gemma-7b-it-Turkish-Reasoning-FT-smol}}
7}