Downloads · 30 days
13
5% of all-time downloads
Pravincoder/Pythia-legal-finetuned-llm
Pythia-legal-finetuned-llm is a text generation model from Pravincoder. 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.
Downloads · 30 days
13
5% of all-time downloads
All-time downloads
254
Public
Repo size
285 MB
Likes
2
Public
Click a slice to open those files.
.bin142 MB · 96%
From the Hugging Face model README
The Pythia 70M model is a transformer-based language model developed by EleutherAI. It is part of the Pythia series, known for its high performance in natural language understanding and generation tasks. With 70 million parameters, it is designed to handle a wide range of NLP applications, offering a balance between computational efficiency and model capability.
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
Downstream uses are model can be fine-tuned further for specific applications like medical AI assistants, legal document generation, and other domain-specific NLP tasks.
Use the code below to get started with the model.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("Pravincoder/Pythia-legal-finetuned-llm")
tokenizer = AutoTokenizer.from_pretrained("EleutherAI/pythia-70m")
def inference(text, model, tokenizer, max_input_tokens=1000, max_output_tokens=200):
input_ids = tokenizer.encode(text, return_tensors="pt", truncation=True, max_length=max_input_tokens)
device = model.device
generated_tokens_with_prompt = model.generate(input_ids=input_ids.to(device), max_length=max_output_tokens)
generated_text_with_prompt = tokenizer.batch_decode(generated_tokens_with_prompt, skip_special_tokens=True)
generated_text_answer = generated_text_with_prompt[0][len(text):]
return generated_text_answer
system_message = "Welcome to the medical AI assistant."
user_message = "What are the symptoms of influenza?"
generated_response = inference(system_message, user_message, model, tokenizer)
print("Generated Response:", generated_response)
The model was fine-tuned using data relevant to the Indian Traffic Law data it is a Private DataSet.
Data preprocessing involved tokenization and formatting suitable for the transformer model.
-Training regime: Mixed precision (fp16)
Email :- [email protected]