QuantaSparkLabs commited on
Commit
44eb5d7
ยท
verified ยท
1 Parent(s): 5fe70a8

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +184 -0
README.md ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ [![Model](https://img.shields.io/badge/Base-Qwen2.5--1.5B--Instruct-blueviolet?style=for-the-badge)](https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct)
24
+ [![Quantization](https://img.shields.io/badge/Quantization-4--bit-purple?style=for-the-badge)](https://huggingface.co/TinyModels/JujutsuKaiserver)
25
+ [![RAG](https://img.shields.io/badge/RAG-FAISS%20Powered-darkviolet?style=for-the-badge)](https://huggingface.co/TinyModels/JujutsuKaiserver)
26
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue?style=for-the-badge)](LICENSE)
27
+ [![Dataset](https://img.shields.io/badge/Dataset-jjk--wiki--corpus-orange?style=for-the-badge)](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>