PEFT
gptsw3_lora_fo_1.3b / README.md
barbaroo's picture
Update README.md
eac75b0 verified
|
raw
history blame
3.27 kB
---
library_name: peft
base_model: AI-Sweden-Models/gpt-sw3-1.3b
datasets:
- barbaroo/Faroese_BLARK_small
- barbaroo/Books_Faroese
language:
- fo
- sv
- is
- da
- 'no'
- en
---
licence: [LICENCE](https://huggingface.co/AI-Sweden-Models/gpt-sw3-1.3b/blob/main/LICENSE)
# Model Card for Model ID
## Model Details
### Model Description
<!-- Provide a longer summary of what this model is. -->
- **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
## How to Get Started with the Model
Use the code below to get started with the model.
```python
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)
```
## Training Details
### Training Data
<!-- This should link to a Data Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. --
[More Information Needed]
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
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](https://huggingface.co/datasets/barbaroo/Faroese_BLARK_small)
Extra training data was taken from a private corpus of Faroese books ( [Faroese Books](https://huggingface.co/datasets/barbaroo/Books_Faroese))
### Testing Data, Factors & Metrics
#### Testing Data
<!-- This should link to a Data Card if possible. -->
Validation/testing was performed on the test split of the Faroese books corpus ( [Faroese Books](https://huggingface.co/datasets/barbaroo/Books_Faroese))
## Training procedure
The following `bitsandbytes` quantization config was used during training:
- quant_method: bitsandbytes
- load_in_8bit: True
- load_in_4bit: False
- llm_int8_threshold: 6.0
- llm_int8_skip_modules: None
- llm_int8_enable_fp32_cpu_offload: False
- llm_int8_has_fp16_weight: False
- bnb_4bit_quant_type: fp4
- bnb_4bit_use_double_quant: False
- bnb_4bit_compute_dtype: float32
### Framework versions
- PEFT 0.6.2.dev0