Downloads · 30 days
0
xiryss/llm-course-hw3-tinyllama-qlora
llm-course-hw3-tinyllama-qlora is a machine learning model from xiryss. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
This model is a fine-tuned version of TinyLlama/TinyLlama-1.1B-Chat-v1.0 on the cardiffnlp/tweeteval dataset to determine tweets tonality in one of the three classes: positive, neutral or negative.
Downloads · 30 days
0
Access
Public
Updated Mar 29, 2025
Repo size
572 MB
Likes
0
Public
Click a slice to open those files.
.safetensors43.3 MB · 91%
From the Hugging Face model README
This model is a fine-tuned version of TinyLlama/TinyLlama-1.1B-Chat-v1.0 on the cardiffnlp/tweet_eval dataset to determine tweets tonality in one of the three classes: positive, neutral or negative.
It was finetuned with 4-bit QLoRA to make training more memory and time efficient. Low-rank finetuning were applied to Q, K, V, O and up projection layers.
This model was trained with batch_size=32, rank = 24, alpha = 48, lora_dropout=0.07, learning_rate = 5e-4 and cosine scheduler on cardiffnlp/tweet_eval for a quarter of an epoch.
The model achieved 0.50 f1-score on the test dataset.
"QT @user In the original draft of the 7th book, Remus Lupin survived the Battle of Hogwarts. #HappyBirthdayRemusLupin" -> "negative"
Correct: "positive"
"QT @user In the original draft of the 7th book, Remus Lupin survived the Battle of Hogwarts. #HappyBirthdayRemusLupin" -> "positive"
from safetensors.torch import load_file
from huggingface_hub import hf_hub_download
model = AutoModelForCausalLM.from_pretrained(f"{REPO_NAME}-tinyllama-qlora", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(f"{REPO_NAME}-tinyllama-qlora")
tokenizer.pad_token = tokenizer.eos_token
tokenizer.padding_side = "left"
QLoRA_saved_model_accuracy = eval(model, dataset["test"], tokenizer)
print(f"Accuracy after tinyllama QLoRA training: {QLoRA_saved_model_accuracy}")