Downloads · 30 days
12
17% of all-time downloads
newmindai/Llama-3.1-8B-Instruct-environmental-chat-template
Llama-3.1-8B-Instruct-environmental-chat-template is a machine learning model from newmindai. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as llama3.1.
<div style="display: flex; justify-content: center; flex-wrap: wrap; gap: 15px; align-items: flex-start;"
Downloads · 30 days
12
17% of all-time downloads
All-time downloads
69
Public
Repo size
1 GB
Likes
0
Public
Click a slice to open those files.
.pt336 MB · 64%
From the Hugging Face model README
<img src="https://cdn-uploads.huggingface.co/production/uploads/683d4880e639f8d647355997/mqbOdFfrC7KjDZbQlLFFj.png" style="width: 100%; max-width: 300px; height: auto;" />
<img src="https://cdn-uploads.huggingface.co/production/uploads/683d4880e639f8d647355997/VGnh14pYg-SXSaEt640qz.png" style="width: 100%; max-width: 150px; height: 100px; margin-top: 35px;" />
</div>This 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 newmindai/EuroHPC-Legal dataset. This model is fine-tuned using Parameter-Efficient Fine-Tuning (PEFT) with LoRA (Low-Rank Adaptation) on the EuroHPC dataset, specifically the environmental subset. The fine-tuning leverages the Axolotl framework for orchestration and Unsloth library for optimized training kernels.
The dataset follows the Chat Template format with conversation structure:
{
"messages": [
{
"role": "system",
"content": "You are a helpful assistant specialized in Turkish legal matters."
},
{
"role": "user",
"content": "Question or task description"
},
{
"role": "assistant",
"content": "Response or answer"
}
]
}
Dataset: newmindai/EuroHPC-Legal (environmental subset)
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# Load base model and tokenizer
base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B-Instruct")
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.1-8B-Instruct")
# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "newmindai/Llama-3.1-8B-Instruct-environmental-chat-template")
# Use chat template for formatting
messages = [
{"role": "system", "content": "You are a helpful assistant specialized in Turkish legal matters."},
{"role": "user", "content": "Explain the benefits of regular exercise"}
]
# Apply chat template
tokenizer.chat_template = tokenizer.default_chat_template
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
# Example usage
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=256)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
This research was supported by the EuroHPC Joint Undertaking (EuroHPC JU) under the Benchmark Access grant agreement No EHPC-BEN-2024B11-003. The authors gratefully acknowledge the computational resources provided by the IT4Innovations National Supercomputing Center (Czech Republic) on the Karolina supercomputer, made available through the EuroHPC JU.
@article{newmind2025,
title={Tailoring AI for Turkish Law: Domain-Specific Fine-Tuning of Small Language Models for Legal Expertise},
author={New Mind AI Team},
journal={Procedia Computer Science},
year={2025},
volume={239},
doi={10.1016/j.procs.2025.08.239},
note={Available online 23 September 2025, Version of Record 23 September 2025}
}