Views
No views yet



1{
2 "instruction": "Task description or question",
3 "input": "Additional context or input data",
4 "output": "Expected response or answer"
5}newmindai/EuroHPC-Legal (competition subset)1from transformers import AutoTokenizer, AutoModelForCausalLM
2from peft import PeftModel
3
4# Load base model and tokenizer
5base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B-Instruct")
6tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.1-8B-Instruct")
7
8# Load LoRA adapter
9model = PeftModel.from_pretrained(base_model, "newmindai/Llama-3.1-8B-Instruct-competition-alpaca")
10
11# Format input according to Alpaca format
12def format_prompt(instruction, input_text=""):
13 if input_text:
14 return f"### Instruction:\n{instruction}\n\n### Input:\n{input_text}\n\n### Response:\n"
15 else:
16 return f"### Instruction:\n{instruction}\n\n### Response:\n"
17
18# Example usage
19prompt = format_prompt("Explain the benefits of regular exercise")
20inputs = tokenizer(prompt, return_tensors="pt")
21outputs = model.generate(**inputs, max_new_tokens=256)
22response = 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}