Downloads · 30 days
8
13% of all-time downloads
tomdickson/riksbanken-mistral-lora
riksbanken-mistral-lora is a machine learning model from tomdickson. 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. The card lists the license as apache-2.0.
Swedish LoRA adapters for Mistral-7B-Instruct, fine-tuned on Riksbanken (Swedish Central Bank) monetary policy reports.
Downloads · 30 days
8
13% of all-time downloads
All-time downloads
60
Public
Repo size
84.5 MB
Likes
0
Public
Click a slice to open those files.
.safetensors83.9 MB · 95%
From the Hugging Face model README
Swedish LoRA adapters for Mistral-7B-Instruct, fine-tuned on Riksbanken (Swedish Central Bank) monetary policy reports.
This model is a LoRA (Low-Rank Adaptation) fine-tune of mistralai/Mistral-7B-Instruct-v0.3 trained on synthetic Q&A pairs generated from Riksbanken's monetary policy reports (2022-2025).
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
"mistralai/Mistral-7B-Instruct-v0.3",
torch_dtype=torch.bfloat16,
device_map="auto",
)
# Load LoRA adapters
model = PeftModel.from_pretrained(base_model, "tomdickson/riksbanken-mistral-lora")
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3")
# Generate
messages = [{"role": "user", "content": "Vad är reporäntan?"}]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True)
outputs = model.generate(inputs.to("cuda"), max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Try the model at: https://swesovereignai.web.app
See the Finetuning LLMs project for training code.
Apache 2.0