Downloads · 30 days
15
5% of all-time downloads
secretmoon/LoRA-Llama-3-MLP
LoRA-Llama-3-MLP is a text generation model from secretmoon. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as cc-by-nc-4.0.
READY FOR USE GGUF VERSION AVAILABLE <br
Downloads · 30 days
15
5% of all-time downloads
All-time downloads
315
Public
Repo size
2.7 GB
Likes
4
Public
Click a slice to open those files.
.safetensors2.7 GB · 100%
From the Hugging Face model README
READY FOR USE GGUF VERSION AVAILABLE <br>
Secretmoon/LoRA-Llama-3-MLP is a LoRA adapter for the Llama-3-8B model, primarily designed to expand the model's knowledge of the MLP:FiM (My Little Pony: Friendship is Magic) universe. This adapter is ideal for generating fan fiction, role-playing scenarios, and other creative projects. The training data includes factual content from the Fandom wiki and canonical fan works that deeply explore the universe.

The base model for this adapter is Sao10K/L3-8B-Stheno-v3.1, an excellent fine-tuned version of the original Llama-3-8B. It excels in story writing and role-playing without suffering from degradation due to overfitting.
You can apply the adapter to the original Safetensors weights of the model and load it through Transformers, or you can merge this adapter with the base model weights and convert it to f16 .gguf for use in llama.cpp.
You can modify this parameter in the adapter_config.json file. For example, I merged the adapter with the base model using LoRA alpha=40.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
from peft import PeftModel
# Loading tokenizer
tokenizer = AutoTokenizer.from_pretrained("Sao10K/L3-8B-Stheno-v3.1")
# Load base model in fp16, if you have ~15gb VRAM at least
base_model = AutoModelForCausalLM.from_pretrained(
"Sao10K/L3-8B-Stheno-v3.1",
trust_remote_code=True,
device_map="auto",
torch_dtype=torch.float16, # optional if you have enough VRAM
)
# Loading LoRA
adapter_name = "secretmoon/LoRA-Llama-3-MLP"
model = PeftModel.from_pretrained(base_model, adapter_name)
model = model.eval()
# Text generation function
def generate_text(prompt, max_length=100, num_return_sequences=1):
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_length=max_length,
num_return_sequences=num_return_sequences,
no_repeat_ngram_size=2,
early_stopping=True
)
return [tokenizer.decode(output, skip_special_tokens=True) for output in outputs]
prompt = "Once upon a time"
generated_texts = generate_text(prompt)
for i, text in enumerate(generated_texts):
print(f"Generated text {i+1}:\n{text}\n")
Example output:
Generated text 1:
Once upon a time, there was a young filly named Luna. She was the younger sister of a powerful princess named Celestia. Luna lived in a beautiful castle with her sister and their parents, the king and queen. The castle was surrounded by a lush, green forest, and it was always filled with the sounds of birds singing and animals playing.
Using Axolotl (https://github.com/OpenAccess-AI-Collective/axolotl)
python3 -m axolotl.cli.merge_lora lora.yml --lora_model_dir="./completed-model"
Conversion to adapter for gguf in OLD llama.cpp
python3 convert-lora-to-ggml.py /path/to/lora/adapter
<br> You can contact me on telegram @monstor86 or discord @starlight2288 <br> Also you can try some RP with this adapter for free in my bot on telegram @Luna_Pony_bot <img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>