Model Card for Luna 2

Model Details

Luna 2 is a next generation text model designed for keeping context over long amounts of text. Luna 2 is generally intended for chatbot purposes.

Model Description

Luna utilizes FlashAttention and AdamW for performance and capability. Lightning is designed to provide quick, coherent outputs, improved with a larger size and weight.

  • Developed by: AobanZ
  • Model type: Transformer
  • Language(s) (NLP): English
  • License: MIT

Model Sources

Uses

Luna is intended to be used for research, analysis and fine-tuning, general conversation, stories and other. It is not intended to be used for professional advice, real writing or any kind of heavy work as generated outputs may be incorrect.

Direct Use

Luna can be used directly for text generation, experimentation, and conversational interactions. Users can provide text prompts and generate responses using the model's built-in language modeling capabilities. Direct use is primarily intended for casual conversation, research and experimentation. Outputs may be incomplete, inaccurate, repetitive, or unrelated to the input, and should be evaluated before being used for other purposes.

Downstream Use

Luna may be fined-tuned for a AI Character, AI Agents, and chat models. However, please note that generated outputs may be corrupted and/or incorrect.

Out-of-Scope Use

Heavy Work may overload the model, which will cause corrupted outputs and/or misinformation. Please provide coherent, steady prompts as the model may not understand unfamiliar terms.

Bias, Risks, and Limitations

Lightning is designed to process english and conversational text ONLY and cannot be fined-tuned for any other uses(eg. Robotics)

Recommendations

We recommend users of Lightning to finetune the model on new text, and add necessary guardrails and precautions to prevent misuse.

How to Get Started with the Model

Use the code below to get started with the model.

import torch
from transformers import AutoModelForCausalLM
from tokenizers import Tokenizer
from huggingface_hub import hf_hub_download
import importlib.util

model_id = "Aobangaming/luna-2-70m"

path = hf_hub_download(model_id, "modeling_luna.py")
spec = importlib.util.spec_from_file_location("lightning", path)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)

model = AutoModelForCausalLM.from_pretrained(
    model_id, trust_remote_code=True, ignore_mismatched_sizes=False
)
tokenizer = Tokenizer.from_file(
    hf_hub_download(model_id, "luna_tokenizer.json")
)

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = model.to(device)

# Generation(OPTIONAL)
    response = module.generate_text(
        model,
        tokenizer,
        prompt,
        max_len=100,
        device=device,
        top_k=40,
        top_p=0.6,
        penalty=1.2,
        temperature=0.8,
        chat_history=history
    )

Training Details

Training Data

Luna was trained a subset of the OASST dataset.

Training Procedure

Luna was trained on an RTX 3050 GPU, using FlashAttention/SDPA and MHA. The model was trained on a large dataset. It was not trained on fine-tuning datasets since memory issues.

Training Results

Epoch Avg Loss Perplexity
1 6.019369138 411.3190
2 4.677136674 107.4620
3 3.918399966 50.3199
4 3.308445575 27.3426
5 2.888957391 17.9746

Training Hyperparameters

Hyperparameter Value Comment
Precision FP32
Optimizer AdamW
Learning rate 4e-4
Batch size 32

Environmental Impact

Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).

  • Hardware Type: RTX 3050 6GB
  • Hours used: 1.5
  • Cloud Provider: AobanLabs
  • Compute Region: Asia
  • Carbon Emitted: ~0.17 kg COâ‚‚e

Technical Specifications

Model Architecture and Objective

Luna uses a 8-layer causal Transformer with 384-dimensional hidden states and 6 attention heads, inherited from previous models. The architecture is based on the base architecture of "Aoban Lightning", which uses pre-layer normalization, causal scaled dot-product attention, a 4× expansion GELU feed-forward network, sinusoidal positional encoding, and untied input/output embeddings.

Hyperparameter Value Comment
Layers 8
D_MODEL 384
Attention Heads 6
Vocabulary ~75003 w/ 200 Sequence length
Downloads last month
387
Safetensors
Model size
71.9M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Aobangaming/luna-2-70m

Finetuned
(4)
this model

Datasets used to train Aobangaming/luna-2-70m

Paper for Aobangaming/luna-2-70m