Downloads · 30 days
9
3% of all-time downloads
barbaroo/gptsw3_lora_fo_1.3b
gptsw3_lora_fo_1.3b is a machine learning model from barbaroo. 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 peft.
Downloads · 30 days
9
3% of all-time downloads
All-time downloads
301
Public
Repo size
26.1 MB
Likes
0
Public
Click a slice to open those files.
.pt17.4 MB · 66%
From the Hugging Face model README
licence: LICENCE
Developed by: Barbara Scalvini, Language Technology Center, University of the Faroe Islands
Model type: This is a LoRA adapter for GPT-Sw3 with continued pre-training on Faroese data (BLARK corpus, private Faroese books repository). Training was performed for 10 epochs (more checkpoints to come!).
Language(s) (NLP): Swedish, English, Norwegian, Danish, Icelandic, Faroese
from model [optional]: AI-Sweden-Models/gpt-sw3-1.3b
Use the code below to get started with the model.
from peft import PeftModel, PeftConfig
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load the Peft configuration and model
config = PeftConfig.from_pretrained("barbaroo/gptsw3_lora_fo_1.3b")
model = AutoModelForCausalLM.from_pretrained("AI-Sweden-Models/gpt-sw3-1.3b")
model = PeftModel.from_pretrained(model, "barbaroo/gptsw3_lora_fo_1.3b")
# Load the tokenizer
tokenizer = AutoTokenizer.from_pretrained("AI-Sweden-Models/gpt-sw3-1.3b")
# Define the prompt
prompt = "fortel mær eina søgu:"
# Tokenize the input
inputs = tokenizer(prompt, return_tensors="pt")
# Generate text
output = model.generate(**inputs, max_length=100,do_sample=True, temperature=0.7)
# Decode the generated text
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
print(generated_text)
We trained our model on a corpus derived from the Basic Language Resource Kit for Faroese. For detailed information about the dataset, please see the BLARK_small Extra training data was taken from a private corpus of Faroese books ( Faroese Books)
Validation/testing was performed on the test split of the Faroese books corpus ( Faroese Books)
The following bitsandbytes quantization config was used during training: