|
|
--- |
|
|
license: apache-2.0 |
|
|
--- |
|
|
|
|
|
<style> |
|
|
/* General Styles */ |
|
|
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;800&display=swap'); |
|
|
body { |
|
|
font-family: 'Montserrat', sans-serif; |
|
|
background-color: #121212; |
|
|
margin: 0; |
|
|
padding: 20px; |
|
|
line-height: 1.6; |
|
|
color: #e0e0e0; |
|
|
display: flex; |
|
|
flex-direction: column; |
|
|
align-items: center; |
|
|
justify-content: center; |
|
|
min-height: 100vh; |
|
|
border-radius: 10px; |
|
|
background: rgba(255, 255, 255, 0.05); |
|
|
} |
|
|
.container { |
|
|
max-width: 1200px; |
|
|
margin: 0 auto; |
|
|
background: linear-gradient(145deg, rgba(20, 35, 55, 0.95), rgba(15, 25, 45, 0.9), rgba(10, 20, 40, 0.85)); |
|
|
padding: 60px; |
|
|
border-radius: 35px; |
|
|
box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), inset 0 0 25px rgba(255, 255, 255, 0.1); |
|
|
position: relative; |
|
|
overflow: hidden; |
|
|
border: 2px solid rgba(100, 200, 255, 0.2); |
|
|
} |
|
|
.container::before { |
|
|
content: ''; |
|
|
position: absolute; |
|
|
top: -60%; |
|
|
left: -60%; |
|
|
width: 220%; |
|
|
height: 220%; |
|
|
background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent); |
|
|
animation: pulse 14s infinite; |
|
|
pointer-events: none; |
|
|
} |
|
|
@keyframes pulse { |
|
|
0% { transform: scale(1); } |
|
|
50% { transform: scale(1.2); } |
|
|
100% { transform: scale(1); } |
|
|
} |
|
|
.section { |
|
|
margin-bottom: 70px; |
|
|
position: relative; |
|
|
} |
|
|
.section:hover { |
|
|
transform: translateY(-7px); |
|
|
transition: all 0.5s ease-in-out; |
|
|
} |
|
|
.detail { |
|
|
padding: 25px; |
|
|
margin-bottom: 25px; |
|
|
border: 1px solid rgba(120, 160, 220, 0.3); |
|
|
border-radius: 20px; |
|
|
background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(100, 140, 200, 0.2)); |
|
|
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(255, 255, 255, 0.2); |
|
|
transition: all 0.4s ease; |
|
|
} |
|
|
.detail:hover { |
|
|
background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(140, 180, 240, 0.25)); |
|
|
transform: translateY(-7px); |
|
|
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), inset 0 0 20px rgba(255, 255, 255, 0.25); |
|
|
} |
|
|
.detail-icon { |
|
|
font-size: 1.8em; |
|
|
color: #63d2ff; |
|
|
margin-right: 20px; |
|
|
} |
|
|
.detail:hover .detail-icon { |
|
|
color: #a2f4ff; |
|
|
transform: scale(1.2); |
|
|
} |
|
|
ul { |
|
|
list-style: none; |
|
|
padding: 0; |
|
|
} |
|
|
ul li { |
|
|
margin: 20px 0; |
|
|
padding: 20px; |
|
|
background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(60, 100, 140, 0.25)); |
|
|
border-radius: 15px; |
|
|
box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3), 0 8px 25px rgba(0, 0, 0, 0.6); |
|
|
transition: all 0.4s ease; |
|
|
} |
|
|
ul li:hover { |
|
|
background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(80, 120, 160, 0.3)); |
|
|
transform: translateX(10px); |
|
|
box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(255, 255, 255, 0.2); |
|
|
} |
|
|
a { |
|
|
color: #63d2ff; |
|
|
text-decoration: none; |
|
|
font-weight: bold; |
|
|
transition: color 0.3s ease, text-shadow 0.3s ease; |
|
|
} |
|
|
a:hover { |
|
|
color: #a2f4ff; |
|
|
text-shadow: 0 0 12px rgba(255, 255, 255, 0.9), 0 0 18px rgba(100, 200, 255, 0.6); |
|
|
} |
|
|
h1, h2, h3 { |
|
|
text-transform: uppercase; |
|
|
color: #e8f0ff; |
|
|
text-shadow: 5px 5px 15px rgba(0, 0, 0, 0.9), 0 0 20px rgba(255, 255, 255, 0.6); |
|
|
font-weight: 700; |
|
|
} |
|
|
</style> |
|
|
<div class="container"> |
|
|
<h1 class="section-title">🚀 NeuroReasoner Chain‑of‑Thought Toolkit</h1> |
|
|
<div class="section"> |
|
|
<div class="section-header"><h2 class="section-title">📂 Included Scripts</h2></div> |
|
|
<div class="section-content"> |
|
|
<ul> |
|
|
<li class="detail"><span class="detail-icon">📦</span><span class="detail-text"><code>chain_of_thought_wrapper.py</code> – Core Python wrapper module for step‑by‑step reasoning.</span></li> |
|
|
<li class="detail"><span class="detail-icon">🖥️</span><span class="detail-text"><code>chain_of_thought_gui.py</code> – Futuristic Streamlit GUI for interactive use.</span></li> |
|
|
</ul> |
|
|
</div> |
|
|
</div> |
|
|
<div class="section"> |
|
|
<div class="section-header"><h2 class="section-title">⚙️ Installation</h2></div> |
|
|
<div class="section-content"> |
|
|
<div class="detail"> |
|
|
<ol> |
|
|
<li>Clone or unzip this folder.</li> |
|
|
<li>Install dependencies: <code>pip install torch transformers streamlit pynvml</code></li> |
|
|
<li>Ensure your model checkpoint (e.g. <code>ayjays132/NeuroReasoner‑1‑NR‑1</code>) is accessible or update the GUI script.</li> |
|
|
</ol> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="section"> |
|
|
<div class="section-header"><h2 class="section-title">👩💻 Importing & Using the Wrapper</h2></div> |
|
|
<div class="section-content"> |
|
|
<div class="detail"><span class="detail-icon">📚</span><span class="detail-text"> |
|
|
<pre>from chain_of_thought_wrapper import ChainOfThoughtWrapper |
|
|
from transformers import AutoTokenizer, AutoModelForCausalLM |
|
|
import torch |
|
|
|
|
|
tokenizer = AutoTokenizer.from_pretrained("ayjays132/NeuroReasoner-1-NR-1") |
|
|
model = AutoModelForCausalLM.from_pretrained("ayjays132/NeuroReasoner-1-NR-1") |
|
|
device = "cuda" if torch.cuda.is_available() else "cpu" |
|
|
model.to(device) |
|
|
|
|
|
cot = ChainOfThoughtWrapper(model=model, tokenizer=tokenizer, device=device) |
|
|
|
|
|
inputs = tokenizer("Why is the sky blue?", return_tensors="pt").to(device) |
|
|
result = cot.generate(input_ids=inputs.input_ids, attention_mask=inputs.attention_mask) |
|
|
|
|
|
for i, step in enumerate(result["reasoning_steps"][0], 1): |
|
|
print(f"Step {i}:", step) |
|
|
print("Final Answer:", result["final_answers"][0])</pre> |
|
|
</span></div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="section"> |
|
|
<div class="section-header"><h2 class="section-title">🖥️ Launching the GUI</h2></div> |
|
|
<div class="section-content"> |
|
|
<div class="detail"><span class="detail-icon">🚀</span><span class="detail-text"><pre>streamlit run chain_of_thought_gui.py</pre>Open the local URL and tweak model, device, chain count, sampling params, then enter your prompt.</span></div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="section"> |
|
|
<div class="section-header"><h2 class="section-title">🔧 GUI Configuration Options</h2></div> |
|
|
<div class="section-content"> |
|
|
<ul> |
|
|
<li class="detail"><span class="detail-icon">🤖</span><span class="detail-text"><strong>Model</strong>: HF repo or local path.</span></li> |
|
|
<li class="detail"><span class="detail-icon">💻</span><span class="detail-text"><strong>Device</strong>: cuda or cpu.</span></li> |
|
|
<li class="detail"><span class="detail-icon">🔢</span><span class="detail-text"><strong># Chains</strong>: Number of reasoning samples.</span></li> |
|
|
<li class="detail"><span class="detail-icon">🔄</span><span class="detail-text"><strong>Self‑Consistency</strong>: Toggle majority‑vote across chains.</span></li> |
|
|
<li class="detail"><span class="detail-icon">⏳</span><span class="detail-text"><strong>Max New Tokens</strong>: Length of generated reasoning.</span></li> |
|
|
<li class="detail"><span class="detail-icon">🎛️</span><span class="detail-text"><strong>Temperature</strong>, <strong>Top‑k</strong>, <strong>Top‑p</strong> & <strong>No‑repeat n‑gram</strong>: Sampling controls.</span></li> |
|
|
</ul> |
|
|
</div> |
|
|
</div> |
|
|
<div class="section"> |
|
|
<div class="section-header"><h2 class="section-title">⏳ Example GUI Session</h2></div> |
|
|
<div class="section-content"> |
|
|
<div class="detail"><span class="detail-icon">🔍</span><span class="detail-text"><pre>▶ Prompt: What causes rainbows? |
|
|
▶ Chains: 3, Self‑Consistency: on |
|
|
▶ Sampling: temp 0.7, top‑k 50, top‑p 0.9 |
|
|
…generating… |
|
|
▼ Chain 1 ▼ |
|
|
1. Sunlight is composed of multiple colors. |
|
|
2. Water droplets refract and disperse each color. |
|
|
3. Observer sees spectrum as arc. |
|
|
Final Answer: Rainbows form when sunlight refracts and disperses through droplets, separating into colors. |
|
|
…</pre></span></div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="section"> |
|
|
<div class="section-header"><h2 class="section-title">📜 License</h2></div> |
|
|
<div class="section-content"> |
|
|
<div class="detail"><span class="detail-icon">📄</span><span class="detail-text">Released under the <strong>MIT License</strong>. Free to use, modify, and share—empower everyone with transparent, step‑by‑step AI reasoning!</span></div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |