Downloads · 30 days
4
1% of all-time downloads
MohamedMotaz/Examination-llama-8b-4bit
Examination-llama-8b-4bit is a text generation model from MohamedMotaz. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
Exam-corrector is a fine-tuned version of the LLama 8b model, specifically adapted to function as a written question corrector. This model grades student answers by comparing them against model answers using a set of…
Downloads · 30 days
4
1% of all-time downloads
All-time downloads
402
Public
Parameters
8.2B
5.7 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors5.7 GB · 100%
How the weights are stored.
U87.2B · 87%
From the Hugging Face model README
Exam-corrector is a fine-tuned version of the LLama 8b model, specifically adapted to function as a written question corrector. This model grades student answers by comparing them against model answers using a set of predefined instructions. The finetuning process was performed using LoRA (Low-Rank Adaptation).
Exam-corrector is designed to provide consistent and fair grading for written answers in exams. It takes both a model answer (the best answer) and a student answer as inputs and returns a grade along with a brief explanation.
The grading process follows these detailed instructions:
{model_answer}
{student_answer}
{grade}<be> {explanation}
This model was fine-tuned using the LoRA (Low-Rank Adaptation) technique. Below is a function to print the number of trainable parameters in the model:
def print_number_of_trainable_model_parameters(model):
trainable_model_params = 0
all_model_params = 0
for _, param in model.named_parameters():
all_model_params += param.numel()
if param.requires_grad:
trainable_model_params += param.numel()
return f"trainable model parameters: {trainable_model_params}\\nall model parameters: {all_model_params}\\npercentage of trainable model parameters: {100 * trainable_model_params / all_model_params:.2f}%"
print(print_number_of_trainable_model_parameters(model))
trainable model parameters: 167772160<br> all model parameters: 4708372480<br> percentage of trainable model parameters: 3.56%<br>
To use this model for grading student answers, you can load it from Hugging Face and pass the appropriate inputs as shown in the example prompt.
from transformers import LlamaTokenizer, LlamaForCausalLM
tokenizer = LlamaTokenizer.from_pretrained("MohamedMotaz/Examination-llama-8b-4bit")
model = LlamaForCausalLM.from_pretrained("MohamedMotaz/Examination-llama-8b-4bit")
model_answer = "The process of photosynthesis involves converting light energy into chemical energy."
student_answer = "Photosynthesis is when plants turn light into energy."
inputs = prompt.format(model_answer, student_answer)
input_ids = tokenizer(inputs, return_tensors="pt").input_ids
outputs = model.generate(input_ids)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
Exam-corrector is a robust tool for automating the grading of written exam answers, ensuring consistent and fair evaluation based on model answers. Feel free to fine-tune further or adapt the model for other specific grading tasks.
For any issues, questions, or contributions, please reach out to me at myLinkedIn.