Downloads · 30 days
53
0% of all-time downloads
mrm8488/limstral-7B-v0.1
limstral-7B-v0.1 is a text generation model from mrm8488. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
<div style="text-align:center;width:250px;height:250px;" <img src="https://huggingface.co/mrm8488/limstral-7B-v0.1/resolve/main/limstrallogo-nb.png" alt="limstral logo"" </div <br /
Downloads · 30 days
53
0% of all-time downloads
All-time downloads
25.7K
Public
Parameters
7.2B
29 GB on disk
Likes
6
Public
Click a slice to open those files.
.safetensors14.5 GB · 100%
From the Hugging Face model README
This model is a fine-tuned version of mistralai/Mistral-7B-v0.1 on the LIMA dataset for instruction following downstream task.
The model was loaded on 8 bits and fine-tuned on the LIMA dataset using the LoRA PEFT technique with the huggingface/peft library and trl/sft for 2 epochs on 1 x A100 (40GB) GPU.
SFT Trainer params:
trainer = SFTTrainer(
model=model,
train_dataset=train_ds,
eval_dataset=test_ds,
peft_config=peft_config,
dataset_text_field="text",
max_seq_length=2048,
tokenizer=tokenizer,
args=training_arguments,
packing=False
)
LoRA config:
config = LoraConfig(
lora_alpha=16,
lora_dropout=0.1,
r=64,
bias="none",
task_type="CAUSAL_LM",
target_modules = ['q_proj', 'k_proj', 'down_proj', 'v_proj', 'o_proj', 'gate_proj', 'up_proj']
)
The following hyperparameters were used during training:
| Step | Training Loss | Validation Loss |
|---|---|---|
| 5 | 1.802800 | 1.848371 |
| 10 | 1.605800 | 1.803416 |
| 15 | 1.844800 | 1.762276 |
| 20 | 1.752600 | 1.754042 |
| 25 | 1.512400 | 1.750550 |
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
repo_id = "mrm8488/limstral-7B-v0.1"
model = AutoModelForCausalLM.from_pretrained(repo_id, torch_dtype=torch.bfloat16)
tokenizer = AutoTokenizer.from_pretrained(repo_id)
gen = pipeline("text-generation", model=model, tokenizer=tokenizer, device=0)
instruction = "[INST] Write an email to say goodbye to me boss [\INST]"
res = gen(instruction, max_new_tokens=512, temperature=0.3, top_p=0.75, top_k=40, repetition_penalty=1.2)
print(res[0]['generated_text'])