This model is a fine-tuned version of
OuteAI/Lite-Oute-1-300M-Instruct on the
cardiffnlp/tweet_eval dataset to determine tweets tonality in one of the three classes: positive, neutral or negative.
It was finetuned with DoRA to make training more memory and time efficient. Low-rank finetuning was applied only to V and K matrices of attention layers.
This model was trained with batch_size=32, rank = 16, alpha = 32, learning_rate = 1e-5 on cardiffnlp/tweet_eval for three epochs.
The model achieved 0.53 f1-score on the test dataset.
Sorry bout the stream last night I crashed out but will be on tonight for sure. Then back to Minecraft in pc tomorrow night. -> "positive"
Sorry bout the stream last night I crashed out but will be on tonight for sure. Then back to Minecraft in pc tomorrow night. -> "neutral. GCSE English \n"
Although there are redundant tokens, the output is considered correct.
1
2from safetensors.torch import load_file
3from huggingface_hub import hf_hub_download
4
5REPO_NAME = "bikmish/llm-course-hw3-dora"
6
7model = AutoModelForCausalLM.from_pretrained(REPO_NAME, device_map="auto")
8tokenizer = AutoTokenizer.from_pretrained(REPO_NAME)
9tokenizer.pad_token = tokenizer.eos_token
10tokenizer.padding_side = "left"
11
12apply_peft_to_module(model, LinearWithDoRA, r=16, alpha=32, target_submodules=["v_proj", "k_proj"])
13model.to(DEVICE)
14
15path = hf_hub_download(REPO_NAME, "model.safetensors")
16state_dict = load_file(path)
17
18model.load_state_dict(state_dict, strict=False)
19
20DoRA_saved_model_accuracy = eval(model, dataset["test"], tokenizer)
21print(f"Accuracy after DoRA training: {DoRA_saved_model_accuracy:.2f}")