File size: 7,745 Bytes
53b687f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f77627a
4ff5e51
 
 
 
 
 
 
 
 
 
 
f77627a
4459d5e
 
 
 
 
 
 
 
 
f77627a
801d773
 
f77627a
 
680f057
f77627a
 
801d773
f77627a
 
 
 
801d773
f77627a
801d773
0bd28c4
801d773
3c4b533
 
 
 
 
 
f77627a
801d773
0bd28c4
f77627a
0bd28c4
f77627a
 
 
0bd28c4
801d773
f77627a
801d773
f77627a
801d773
92ecaa4
 
 
 
0bd28c4
 
 
801d773
92ecaa4
801d773
0bd28c4
 
 
 
801d773
92ecaa4
 
801d773
92ecaa4
 
 
801d773
92ecaa4
 
 
801d773
92ecaa4
801d773
92ecaa4
 
 
 
 
 
 
801d773
92ecaa4
801d773
92ecaa4
 
801d773
92ecaa4
 
 
f77627a
801d773
 
0bd28c4
801d773
f77627a
801d773
f77627a
801d773
f77627a
 
 
801d773
0bd28c4
801d773
f77627a
801d773
f77627a
801d773
f77627a
0bd28c4
 
 
 
 
 
 
801d773
0bd28c4
801d773
f77627a
801d773
f77627a
 
 
801d773
0bd28c4
801d773
f77627a
801d773
f77627a
801d773
f77627a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
---
license: apache-2.0
language:
  - en
tags:
  - renpy
  - visual-novel
  - storytelling
  - creative-writing
  - llama-3
  - qlora
  - finetuned
  - text-generation
  - natural-language-to-script
  - instruction-free
inference: false
widget:
  - text: "A detective wakes up in a town where no one remembers him."
  - text: "Every time she falls asleep, she wakes up in another version of her life."
  - text: "A cursed mirror swaps your life with your reflection."
datasets:
  - custom
model-index:
  - name: Secunda-0.3-F16-QA
    results: []
---


```ascii
                          
       β–„β–„β–„β–„β–„   β–„β–ˆβ–ˆβ–ˆβ–„   β–„β–ˆβ–„      β–„      β–„   β–ˆβ–ˆβ–„   β–ˆβ–ˆ       β–ˆβ–ˆβ–ˆβ–ˆβ–„     β–„β–ˆ 
       β–ˆ     β–€β–„ β–ˆβ–€   β–€  β–ˆβ–€ β–€β–„     β–ˆ      β–ˆ  β–ˆ  β–ˆ  β–ˆ β–ˆ      β–ˆ   β–ˆ     β–ˆβ–ˆ 
    β–„   β–€β–€β–€β–€β–„   β–ˆβ–ˆβ–„β–„    β–ˆ   β–€  β–ˆ   β–ˆ β–ˆβ–ˆ   β–ˆ β–ˆ   β–ˆ β–ˆβ–„β–„β–ˆ     β–ˆ   β–ˆ     β–ˆβ–ˆ 
     β–€β–€β–„β–„β–„β–„β–€    β–ˆβ–„   β–„β–€ β–ˆβ–„  β–„β–€ β–ˆ   β–ˆ β–ˆ β–ˆ  β–ˆ β–ˆ  β–ˆ  β–ˆ  β–ˆ     β–ˆ   β–ˆ     β–β–ˆ 
               β–€β–ˆβ–ˆβ–ˆβ–€   β–€β–ˆβ–ˆβ–ˆβ–€  β–ˆβ–„ β–„β–ˆ β–ˆ  β–ˆ β–ˆ β–ˆβ–ˆβ–ˆβ–€     β–ˆ     β–€β–ˆβ–ˆβ–ˆβ–ˆ  β–β–ˆ  ▐   
                               β–€β–€β–€  β–ˆ   β–ˆβ–ˆ         β–ˆ                          
                                                 β–€                           
   
                      β‹†β‹†ΰ­¨ΰ­§Λš THE PRIMΓ‰TOILE ENGINE Λšΰ­¨ΰ­§β‹†ο½‘Λšβ‹†
                  β€” Visual Novel generation under starlight β€”
```
| Version                                               | Type            | Strengths                                                                 | Weaknesses                                                           | Recommended Use             |
|-------------------------------------------------------|-----------------|---------------------------------------------------------------------------|----------------------------------------------------------------------|-----------------------------|
| [Secunda-0.1-GGUF](https://huggingface.co/Yaroster/Secunda-0.1-GGUF) / [RAW](https://huggingface.co/Yaroster/Secunda-0.1-RAW) | Instruction     | - Most precise<br>- Coherent code<br>- Perfected Modelfile                | - Smaller context / limited flexibility                              | **Production / Baseline**  |
| [Secunda-0.3-F16-QA](https://huggingface.co/Yaroster/Secunda-0.3-F16-QA)        | QA-based Input  | - Acceptable for question-based generation                               | - Less accurate than 0.1<br>- Not as coherent                        | Prototyping (QA mode)       |
| [Secunda-0.3-F16-TEXT](https://huggingface.co/Yaroster/Secunda-0.3-F16-TEXT)    | Text-to-text    | - Flexible for freeform tasks                                            | - Slightly off<br>- Modelfile-dependent                             | Experimental / Text rewrite |
| [Secunda-0.3-GGUF](https://huggingface.co/Yaroster/Secunda-0.3-GGUF)            | GGUF build      | - Portable GGUF of 0.3                                                   | - Inherits 0.3 weaknesses                                            | Lightweight local testing   |
| [Secunda-0.5-RAW](https://huggingface.co/Yaroster/Secunda-0.5-RAW)              | QA Natural      | - Best QA understanding<br>- Long-form generation potential               | - Inconsistent output length<br>- Some instability                   | Research / Testing LoRA     |
| [Secunda-0.5-GGUF](https://huggingface.co/Yaroster/Secunda-0.5-GGUF)            | GGUF build      | - Portable, inference-ready version of 0.5                                | - Shares issues of 0.5                                               | Offline experimentation     |
| [Secunda-0.1-RAW](https://huggingface.co/Yaroster/Secunda-0.1-RAW)              | Instruction     | - Same base as 0.1-GGUF                                                   | - Same as 0.1                                                        | Production backup           |

---

## πŸŒ™ Overview

**Secunda-0.1-RAW** is the original release of the Secunda fine-tuned model family, trained to produce polished **Ren'Py `.rpy` scripts** from structured instructions!

The model outputs:

* `define` blocks for named characters (with colors!)
* `image` declarations for scenes & sprites
* A clear `label start:` structure
* Emotional dialogue, branching `menu`s, `jump`s, and proper `return`

This version is *the most stable so far* β€” often more reliable than 0.3!

---

<b>/!\ NO HUMAN-MADE DATA WAS USED TO TRAIN THIS AI !
Secunda takes much pride in making sure the training data is scripted ! /!\ </b>

If you like Visual Novels, please visit [itch.io](itch.io) and support independant creators ! 


## ✨ Moonlight Specs

* **Base model**: `meta-llama/Meta-Llama-3.1-8B`
* **Fine-tuning**: QLoRA (r=64, alpha=16, dropout=0.1)
* **Precision**: Float16 (FP16)
* **Max tokens**: 4096
* **Hardware used**: RTX 4070, 64GB RAM

---

## πŸͺ„ Inference in the Starlight

### Setup

## πŸš€ Quick Start

### Installation

```bash
pip install transformers accelerate peft bitsandbytes
```

### Inference Script Example

```python
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch

BASE_MODEL = "meta-llama/Meta-Llama-3.1-8B"
LORA_PATH = "path/to/Secunda-0.1-RAW"

model = AutoModelForCausalLM.from_pretrained(BASE_MODEL, torch_dtype=torch.float16, device_map="auto")
model = PeftModel.from_pretrained(model, LORA_PATH)
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)

def build_prompt(idea):
    return f"""You are an expert writer of visual novels in Ren'Py. 
Generate a complete and polished Ren'Py script based on the following concept:

\"\"\"{idea}\"\"\"

Your output should include:
- `define` blocks for all characters (with names and color codes)
- `image` blocks for key backgrounds and character sprites
- `label start:` with a clear beginning
- Proper `scene`, `show`, `menu`, `play music/sound`, and `jump` statements
- Emotional dialogue and natural pacing
- A proper ending (`return`) or narrative closure

Structure the script as a `.rpy` file β€” do not include explanations, comments, or placeholder text."""

prompt = build_prompt("A young girl finds a photo album that shows moments that haven't happened yet.")
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)

with torch.no_grad():
    outputs = model.generate(**inputs, max_new_tokens=2048, temperature=0.85, top_p=0.95)
    print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```


---

## 🌌 Evaluation

This model has:

* Generated 1000+ `.rpy` files
* Passed human review for structure, creativity & syntax
* > 90% valid output with minimal manual tweaks

---

## ☁️ Talking to the Moon

If you use **Secunda-0.1-RAW**, please star and cite:

```bibtex
@misc{secunda2025,
  title={Secunda-0.1-RAW},
  author={Yaroster},
  year={2025},
  note={https://huggingface.co/Yaroster/Secunda-0.1-RAW}
}
```

---

## πŸͺ From the Cosmos

* [Secunda-0.3-F16-QA](https://huggingface.co/Yaroster/Secunda-0.3-F16-QA) β€” experimental question-answer variant
* [Secunda-0.3-F16-TEXT](https://huggingface.co/Yaroster/Secunda-0.3-F16-TEXT) β€” for less structured generation
* [PrimΓ©toile](https://yaroster.com) β€” full VN pipeline

---

⋆°.☾ Secunda-0.1-RAW ☽.°⋆

> ✧ Because every visual novel deserves to begin with a spark of magic ✧

⚠️ This repo contains **only the LoRA adapter weights**. To use the model, download the base `LLaMA 3.1` from Meta (terms apply): [https://ai.meta.com/resources/models-and-libraries/llama-downloads/](https://ai.meta.com/resources/models-and-libraries/llama-downloads/)