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 (kvkk 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-kvkk-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}
10```---
11license: llama3.1
12datasets:
13- newmindai/Euro_HPC
14language:
15- tr
16- en
17base_model:
18- meta-llama/Llama-3.1-8B-Instruct
19tags:
20- EuroHPC
21- Karolina
22- Axolotl
23- Unsloth
24---
25
26<div style="display: flex; justify-content: center; flex-wrap: wrap; gap: 15px; align-items: flex-start;">
27 <img src="https://cdn-uploads.huggingface.co/production/uploads/683d4880e639f8d647355997/mqbOdFfrC7KjDZbQlLFFj.png"
28 style="width: 100%; max-width: 300px; height: auto;" />
29 <img src="https://cdn-uploads.huggingface.co/production/uploads/683d4880e639f8d647355997/VGnh14pYg-SXSaEt640qz.png"
30 style="width: 100%; max-width: 150px; height: auto;" />
31</div>
32
33## Model Card
34
35This document describes a parameter-efficient fine-tuning setup using LoRA on the EuroHPC Karolina system. Axolotl provides flexible orchestration and Unsloth supplies optimized kernels for high-throughput training on the Euro_HPC dataset. This model is fine-tuned using Parameter-Efficient Fine-Tuning (PEFT) with LoRA (Low-Rank Adaptation) on the EuroHPC dataset, specifically the kvkk subset. The fine-tuning leverages the Axolotl framework for orchestration and Unsloth library for optimized training kernels.
36
37### Hyperparameters
38
39* **LoRA Rank**: 16
40* **LoRA Alpha**: 32
41* **LoRA Dropout**: 0.05
42* **Learning Rate**: 3×10⁻⁵ with cosine scheduling
43* **Training Epochs**: 3 per domain
44* **Batch Size**: Optimized for A100 memory capacity
45
46### Architecture
47
48* **Base Model**: Llama-3.1-8B-Instruct (Meta)
49* **Fine-tuning Method**: LoRA (Low-Rank Adaptation)
50* **Parameter Efficiency**: Only trainable LoRA parameters, frozen base model
51* **Model Size**: 8B parameters (base) + LoRA adapters
52
53## Hardware and Software
54
55* **Orchestration**: [Axolotl framework](https://axolotl.ai/)
56* **Acceleration**: [Unsloth library](https://unsloth.ai/)
57* **Backend**: PyTorch with CUDA support
58* **System**: EuroHPC Karolina supercomputer
59* **GPUs**: NVIDIA A100 (8 × 40 GB per node, 320 GB HBM2 total)
60* **Utilization**: 85–90% GPU and memory efficiency
61* **Total Compute**: ~600 GPU hours
62
63## Data
64
65### Input Format
66
67The dataset follows the **Alpaca format** with three key fields:
68
69```json
70{
71 "instruction": "Task description or question",
72 "input": "Additional context or input data",
73 "output": "Expected response or answer"
74}newmindai/Euro_HPC (kvkk 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-kvkk-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}