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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- TinyModels/jjk-wiki-corpus
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
+
tags:
|
| 9 |
+
- RAG
|
| 10 |
+
- Qwen2.5
|
| 11 |
+
- Jujutsu-Kaisen
|
| 12 |
+
- Anime
|
| 13 |
+
- Knowledge-Bot
|
| 14 |
+
- Retrieval-Augmented-Generation
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
<div align="center">
|
| 18 |
+
|
| 19 |
+
# ๐ฃ JujutsuKaiserver
|
| 20 |
+
|
| 21 |
+
### *The Cursed Intelligence. The Canon Oracle.*
|
| 22 |
+
|
| 23 |
+
[](https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct)
|
| 24 |
+
[](https://huggingface.co/TinyModels/JujutsuKaiserver)
|
| 25 |
+
[](https://huggingface.co/TinyModels/JujutsuKaiserver)
|
| 26 |
+
[](LICENSE)
|
| 27 |
+
[](https://huggingface.co/datasets/TinyModels/jjk-wiki-corpus)
|
| 28 |
+
|
| 29 |
+
<br/>
|
| 30 |
+
|
| 31 |
+
> *"Throughout Heaven and Earth, I alone am the honored one."*
|
| 32 |
+
> โ **Satoru Gojo** | and also this model, kind of.
|
| 33 |
+
|
| 34 |
+
<br/>
|
| 35 |
+
|
| 36 |
+
**JujutsuKaiserver** is a Retrieval-Augmented Generation (RAG) model built for one purpose:
|
| 37 |
+
to answer anything and everything about the **Jujutsu Kaisen** universe โ with canon-backed accuracy, zero hallucination tolerance, and the confidence of Unlimited Void.
|
| 38 |
+
|
| 39 |
+
</div>
|
| 40 |
+
|
| 41 |
+
---
|
| 42 |
+
|
| 43 |
+
## โก What It Does
|
| 44 |
+
|
| 45 |
+
Ask it anything. Techniques. Domains. Arcs. Hidden lore. Character relationships. Cursed Energy mechanics. It retrieves the most relevant passages from a **200+ page wiki corpus**, feeds them into a fine-tuned **Qwen2.5-1.5B-Instruct** backbone, and gives you a clean, grounded answer โ not a guess.
|
| 46 |
+
|
| 47 |
+
| Ask This | Get This |
|
| 48 |
+
|----------|----------|
|
| 49 |
+
| *"What is Sukuna's Shrine?"* | Full technique breakdown with canon context |
|
| 50 |
+
| *"How does Mahito's Idle Transfiguration work?"* | Soul-level mechanics explained accurately |
|
| 51 |
+
| *"What happened in the Shibuya Incident?"* | Arc summary backed by wiki chunks |
|
| 52 |
+
| *"Who is the strongest Grade 1 sorcerer?"* | Ranked answer with sourced reasoning |
|
| 53 |
+
|
| 54 |
+
---
|
| 55 |
+
|
| 56 |
+
## ๐ง Architecture
|
| 57 |
+
|
| 58 |
+
```
|
| 59 |
+
User Query
|
| 60 |
+
โ
|
| 61 |
+
โผ
|
| 62 |
+
sentence-transformers (all-MiniLM-L6-v2)
|
| 63 |
+
โ [embed query]
|
| 64 |
+
โผ
|
| 65 |
+
FAISS Index (jjk_index.faiss)
|
| 66 |
+
โ [top-5 relevant wiki chunks]
|
| 67 |
+
โผ
|
| 68 |
+
Qwen2.5-1.5B-Instruct (4-bit)
|
| 69 |
+
โ [context + question โ chat template]
|
| 70 |
+
โผ
|
| 71 |
+
Canon-grounded Answer
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
### Model Composition
|
| 75 |
+
|
| 76 |
+
| Component | Details |
|
| 77 |
+
|-----------|---------|
|
| 78 |
+
| ๐ค **Base LLM** | `Qwen/Qwen2.5-1.5B-Instruct` (4-bit quantized) |
|
| 79 |
+
| ๐ข **Embeddings** | `sentence-transformers/all-MiniLM-L6-v2` |
|
| 80 |
+
| ๐ฆ **Vector Store** | FAISS โ `jjk_index.faiss` |
|
| 81 |
+
| ๐ **Knowledge Base** | 120+ cleaned JJK Fandom Wiki articles (`chunks.txt`) |
|
| 82 |
+
| ๐ง **Pipeline** | Custom `JujutsuKaiserver` class with Qwen chat template |
|
| 83 |
+
|
| 84 |
+
---
|
| 85 |
+
|
| 86 |
+
## ๐ Quick Start
|
| 87 |
+
|
| 88 |
+
```python
|
| 89 |
+
from huggingface_hub import snapshot_download
|
| 90 |
+
|
| 91 |
+
model_dir = snapshot_download("TinyModels/JujutsuKaiserver")
|
| 92 |
+
|
| 93 |
+
import sys
|
| 94 |
+
sys.path.insert(0, model_dir)
|
| 95 |
+
from pipeline import JujutsuKaiserver
|
| 96 |
+
|
| 97 |
+
bot = JujutsuKaiserver(model_dir=model_dir)
|
| 98 |
+
|
| 99 |
+
# Ask anything
|
| 100 |
+
print(bot.ask("What is Gojo's Domain Expansion called?"))
|
| 101 |
+
# โ "Infinite Void (็ก้็ฉบๅฆ). It..."
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
> โ ๏ธ **Requirements**: `bitsandbytes`, GPU with **โฅ6 GB VRAM**. CPU inference works but is slow.
|
| 105 |
+
|
| 106 |
+
### Install Dependencies
|
| 107 |
+
|
| 108 |
+
```bash
|
| 109 |
+
pip install transformers bitsandbytes faiss-cpu sentence-transformers huggingface_hub
|
| 110 |
+
```
|
| 111 |
+
|
| 112 |
+
---
|
| 113 |
+
|
| 114 |
+
## ๐ฅ๏ธ Gradio Demo (Optional)
|
| 115 |
+
|
| 116 |
+
Spin up a local chat UI in seconds:
|
| 117 |
+
|
| 118 |
+
```python
|
| 119 |
+
import gradio as gr
|
| 120 |
+
from pipeline import JujutsuKaiserver
|
| 121 |
+
|
| 122 |
+
bot = JujutsuKaiserver(model_dir="<path_to_downloaded_model>")
|
| 123 |
+
|
| 124 |
+
def chat(message, history):
|
| 125 |
+
return bot.ask(message)
|
| 126 |
+
|
| 127 |
+
gr.ChatInterface(
|
| 128 |
+
fn=chat,
|
| 129 |
+
title="๐ฃ JujutsuKaiserver",
|
| 130 |
+
description="Ask anything about the JJK universe."
|
| 131 |
+
).launch()
|
| 132 |
+
```
|
| 133 |
+
|
| 134 |
+
---
|
| 135 |
+
|
| 136 |
+
## โจ Features
|
| 137 |
+
|
| 138 |
+
- ๐ **Factual Q&A** โ Every answer is grounded in retrieved wiki content, not imagination
|
| 139 |
+
- ๐ซ **Hallucination Guard** โ Model is prompted to say *"I don't know"* when context is insufficient
|
| 140 |
+
- ๐ **Deep Coverage** โ 200+ wiki pages: characters, techniques, domains, arcs, lore
|
| 141 |
+
- โก **T4-Friendly** โ 4-bit quantization means it runs on free Colab tiers
|
| 142 |
+
- ๐ค **Gradio Ready** โ One-script local demo included out of the box
|
| 143 |
+
|
| 144 |
+
---
|
| 145 |
+
|
| 146 |
+
## โ ๏ธ Known Limitations
|
| 147 |
+
|
| 148 |
+
- **Recent chapters** beyond the scraping date may not be indexed yet
|
| 149 |
+
- **Ambiguous context** can still occasionally produce imperfect answers โ being addressed via a feedback loop
|
| 150 |
+
- **Roleplay mode** is possible with a custom system prompt, but this version is optimized for factual retrieval
|
| 151 |
+
|
| 152 |
+
---
|
| 153 |
+
|
| 154 |
+
## ๐ฎ Roadmap
|
| 155 |
+
|
| 156 |
+
- [ ] **Live Feedback Flagging** โ ๐/๐ votes from the Gradio Space feed a correction dataset automatically
|
| 157 |
+
- [ ] **Self-Correcting Pipeline** โ Weekly DPO fine-tuning on flagged examples + FAISS index refresh
|
| 158 |
+
- [ ] **Expanded KB** โ Episode transcripts, manga panels text, community lore
|
| 159 |
+
- [ ] **Streaming Support** โ Token-by-token output for snappier UX
|
| 160 |
+
|
| 161 |
+
---
|
| 162 |
+
|
| 163 |
+
## ๐ Repo Structure
|
| 164 |
+
|
| 165 |
+
```
|
| 166 |
+
JujutsuKaiserver/
|
| 167 |
+
โโโ pipeline.py # Core RAG pipeline class
|
| 168 |
+
โโโ jjk_index.faiss # FAISS vector index
|
| 169 |
+
โโโ chunks.txt # Raw wiki knowledge base
|
| 170 |
+
โโโ generation_config.json
|
| 171 |
+
โโโ README.md
|
| 172 |
+
```
|
| 173 |
+
|
| 174 |
+
---
|
| 175 |
+
|
| 176 |
+
<div align="center">
|
| 177 |
+
|
| 178 |
+
**Built with ๐ฉธ and cursed energy for the JJK community.**
|
| 179 |
+
|
| 180 |
+
*Got a question the bot fumbled? Open a [Discussion](https://huggingface.co/TinyModels/JujutsuKaiserver/discussions) and help us fix it.*
|
| 181 |
+
|
| 182 |
+
`TinyModels` โข `QuantaSparkLabs` โข Apache 2.0
|
| 183 |
+
|
| 184 |
+
</div>
|