This model is a fine-tuned version of LLaMA 3 utilizing the Quantized Low-Rank Adaptation (QLoRA) technique.
It is designed to answer questions related to the academic legislation of the Universidade Federal do Amazonas (UFAM).
The training process involved generating a synthetic dataset of questions and answers based on the legislation,
which includes various resolutions and norms provided by UFAM.
Developed by: Matheus dos Santos Palheta
Model type: More Information Needed
Language(s) (NLP): Portuguese, English
License: MIT
Finetuned from model: unsloth/llama-3-8b-bnb-4bit
Model Sources [optional]
Repository: [More Information Needed]
Uses
This model is intended for use by anyone with questions about UFAM's legislation. It is especially designed for students, professors, and administrative staff who need quick and accurate answers regarding academic policies and regulations. The model aims to support these groups by providing reliable information, thereby facilitating a better understanding of the rules and guidelines that govern their academic and professional activities at UFAM.
Direct Use
This model can be directly used to answer questions regarding UFAM's academic legislation without additional fine-tuning.
Downstream Use
The model can be integrated into larger ecosystems or applications, particularly those focusing on academic information systems,
legal information retrieval, or automated student support systems from UFAM.
Out-of-Scope Use
This model is not suitable for general-purpose question answering beyond the scope of UFAM's academic legislation.
It should not be used for legal advice or any critical decision-making processes outside its trained domain.
Bias, Risks, and Limitations
While the model has been fine-tuned for accuracy in the context of UFAM's legislation, it may still exhibit biases present in the training data.
Additionally, the model's performance is constrained by the quality and comprehensiveness of the synthetic dataset generated.
How to Get Started with the Model
Use the code below to get started with the model.
python
1!pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"2!pip install --no-deps "xformers<0.0.27""trl<0.9.0" peft accelerate bitsandbytes
34from datasets import load_dataset
5from datasets import Dataset
6import pandas as pd
78from unsloth import FastLanguageModel
9import torch
10max_seq_length =204811dtype =None12load_in_4bit =True13model, tokenizer = FastLanguageModel.from_pretrained(14 model_name ="matiusX/lamma-legis-ufam",15 max_seq_length = max_seq_length,16 dtype = dtype,17 load_in_4bit = load_in_4bit,18)19FastLanguageModel.for_inference(model)2021prompt ="""Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
2223### Instruction:
24{}
2526### Input:
27{}
2829### Response:
30{}"""3132inputs = tokenizer(33[34 prompt.format(35 contexto,# contexto36 pergunta,# pergunta37"",# resposta - deixar em branco38)39], return_tensors ="pt").to("cuda")4041outputs = model.generate(**inputs, max_new_tokens =64, use_cache =True)42tokenizer.batch_decode(outputs)4344from transformers import TextStreamer
45text_streamer = TextStreamer(tokenizer, skip_prompt=True)46_ = model.generate(**inputs, streamer = text_streamer, max_new_tokens =128)
Training Details
Training Data
The training data for this model is based on the academic legislation of UFAM. It includes a wide range of documents,
such as resolutions and norms, which have been pre-processed and structured to create a synthetic dataset of questions and answers.
For more details on the dataset, including the pre-processing and filtering steps, please refer to the Dataset Card available here.