Downloads · 30 days
6
0% of all-time downloads
Muhammad2003/Llama3-LegalLM
Llama3-LegalLM is a machine learning model from Muhammad2003. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Welcome to LegalAI LLM, a lightweight and efficient legal-specific large language model (LLM) designed to transform the legal industry with advanced natural language processing capabilities. Built with 497M parameters…
Downloads · 30 days
6
0% of all-time downloads
All-time downloads
1.5K
Public
Parameters
362M
1.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.4 GB · 100%
From the Hugging Face model README
Welcome to LegalAI LLM, a lightweight and efficient legal-specific large language model (LLM) designed to transform the legal industry with advanced natural language processing capabilities. Built with 497M parameters, this model offers unparalleled accuracy, transparency, and reliability for legal professionals, educators, and the general public.
pip install transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
checkpoint = "Muhammad2003/Llama3-LegalLM"
device = "cuda" # for GPU usage or "cpu" for CPU usage
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
# for multiple GPUs install accelerate and do `model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto")`
model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
messages = [{"role": "user", "content": "What is the capital of France."}]
input_text=tokenizer.apply_chat_template(messages, tokenize=False)
inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
outputs = model.generate(inputs, max_new_tokens=50, temperature=0.2, top_p=0.9, do_sample=True)
print(tokenizer.decode(outputs[0]))

LegalAI LLM is trained on publicly available, licensed legal datasets:
All datasets were collected with full adherence to ownership, intellectual property, and licensing requirements, ensuring complete transparency and no risk of legal repercussions for users.
LegalAI LLM adheres to strict ethical guidelines:
This project is licensed under the MIT License. See the LICENSE file for more details.
For support or inquiries, please reach out at [email@example.com].
Explore the future of legal AI with LegalAI LLM!