Downloads · 30 days
7
15% of all-time downloads
lukashm/LitLex-Llama-LT-v1
LitLex-Llama-LT-v1 is a text generation model from lukashm. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as mit.
LitLex is a specialized Large Language Model (LLM) fine-tuned to understand and interpret the Administrative Code of the Republic of Lithuania (ANK).
Downloads · 30 days
7
15% of all-time downloads
All-time downloads
48
Public
Repo size
688 MB
Likes
1
Public
Click a slice to open those files.
.safetensors671 MB · 97%
From the Hugging Face model README
LitLex is a specialized Large Language Model (LLM) fine-tuned to understand and interpret the Administrative Code of the Republic of Lithuania (ANK).
Built with Meta Llama 3 and optimized using Unsloth, this model demonstrates high capability in citing legal articles, calculating fines, and explaining regulations in the Lithuanian language.
unsloth/llama-3-8b-bnb-4bit (Quantized)You can run this model using the unsloth library for faster inference, or standard transformers.
pip install unsloth torch transformers
from unsloth import FastLanguageModel
import torch
# Load the model and tokenizer
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "lukashm/LitLex-Llama-LT-v1",
max_seq_length = 2048,
dtype = None,
load_in_4bit = True,
)
FastLanguageModel.for_inference(model)
# Define the prompt template
alpaca_prompt = """Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
{}
### Response:
"""
# Ask a question
question = "Kokia bauda gresia už greičio viršijimą daugiau kaip 50 km/h?"
inputs = tokenizer([alpaca_prompt.format(question, "")], return_tensors="pt").to("cuda")
# Generate answer
outputs = model.generate(**inputs, max_new_tokens=256, use_cache=True)
response = tokenizer.batch_decode(outputs)[0]
print(response.split("### Response:\n")[1].replace("<|end_of_text|>", ""))
The model was fine-tuned on a custom dataset (ank_dataset.json) derived from the Official Administrative Code of Lithuania (ANK) via e-seimas.lrs.lt.
This model is a Proof of Concept (MVP) intended for educational and research purposes.