Views
No views yet



1{
2 "messages": [
3 {
4 "role": "system",
5 "content": "You are a helpful assistant specialized in Turkish legal matters."
6 },
7 {
8 "role": "user",
9 "content": "Question or task description"
10 },
11 {
12 "role": "assistant",
13 "content": "Response or answer"
14 }
15 ]
16}newmindai/EuroHPC-Legal (energy subset)1from transformers import AutoTokenizer, AutoModelForCausalLM
2
3# Load fine-tuned model and tokenizer
4model = AutoModelForCausalLM.from_pretrained("newmindai/Llama-3.1-8B-Instruct-energy-chat-template")
5tokenizer = AutoTokenizer.from_pretrained("newmindai/Llama-3.1-8B-Instruct-energy-chat-template")
6
7# Use chat template for formatting
8messages = [
9 {"role": "system", "content": "You are a helpful assistant specialized in Turkish legal matters."},
10 {"role": "user", "content": "Explain the benefits of regular exercise"}
11]
12
13# Apply chat template
14tokenizer.chat_template = tokenizer.default_chat_template
15prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
16
17# Example usage
18inputs = tokenizer(prompt, return_tensors="pt")
19outputs = model.generate(**inputs, max_new_tokens=256)
20response = tokenizer.decode(outputs[0], skip_special_tokens=True)1@article{newmind2025,
2 title={Tailoring AI for Turkish Law: Domain-Specific Fine-Tuning of Small Language Models for Legal Expertise},
3 author={New Mind AI Team},
4 journal={Procedia Computer Science},
5 year={2025},
6 volume={239},
7 doi={10.1016/j.procs.2025.08.239},
8 note={Available online 23 September 2025, Version of Record 23 September 2025}
9}