Nekochu commited on
Commit
d36cf5b
·
verified ·
1 Parent(s): a8293d1

Body scrolls (wheel works in the iframe); give the model today's date

Browse files
Files changed (3) hide show
  1. index.html +1 -0
  2. main.js +2 -1
  3. style.css +2 -0
index.html CHANGED
@@ -44,6 +44,7 @@
44
  <code>search</code> reads DuckDuckGo results (Brave as backup) and <code>browse</code> reads pages through <a href="https://jina.ai/reader" target="_blank" rel="noopener">Jina Reader</a>'s anonymous, browser-friendly endpoint
45
  (it renders JavaScript and gets past most bot walls), with Wikipedia and OpenAlex search and the Wayback Machine as fallbacks.
46
  The terminal is a small safe runner written in JavaScript for <code>head tail rg grep sed wc sort uniq cut tr nl</code>; there is no shell. Private and local addresses are refused, as are huggingface.co pages (as upstream blocks them). Each filter pipeline is limited to 5 seconds.</p>
 
47
  <p><b>Honest limits.</b> A 4-bit-class model on a free search stack is not the paper's setup: results can be thinner than the reported benchmarks, the free services rate-limit (about 20 page reads a minute, so steps can pause), and answers can be wrong. Check the sources it cites.
48
  The model runs on your device; your search queries and the URLs it opens are sent to DuckDuckGo/Brave and Jina (anonymously, from your browser).</p>
49
  <p id="store"></p>
 
44
  <code>search</code> reads DuckDuckGo results (Brave as backup) and <code>browse</code> reads pages through <a href="https://jina.ai/reader" target="_blank" rel="noopener">Jina Reader</a>'s anonymous, browser-friendly endpoint
45
  (it renders JavaScript and gets past most bot walls), with Wikipedia and OpenAlex search and the Wayback Machine as fallbacks.
46
  The terminal is a small safe runner written in JavaScript for <code>head tail rg grep sed wc sort uniq cut tr nl</code>; there is no shell. Private and local addresses are refused, as are huggingface.co pages (as upstream blocks them). Each filter pipeline is limited to 5 seconds.</p>
47
+ <p><b>One addition.</b> The system prompt is Ai2's, plus one line giving today's date (the model does not know it and otherwise searches for old news). Add <code>?date=0</code> to the address to remove it.</p>
48
  <p><b>Honest limits.</b> A 4-bit-class model on a free search stack is not the paper's setup: results can be thinner than the reported benchmarks, the free services rate-limit (about 20 page reads a minute, so steps can pause), and answers can be wrong. Check the sources it cites.
49
  The model runs on your device; your search queries and the URLs it opens are sent to DuckDuckGo/Brave and Jina (anonymously, from your browser).</p>
50
  <p id="store"></p>
main.js CHANGED
@@ -85,7 +85,8 @@ async function research(question) {
85
  const { engine, system } = await loadEngine();
86
  if (aborted) { status('Stopped.', 0); return; }
87
  const nCtx = Math.min(CTX, engine.nCtx || CTX), RESERVE = Math.min(6000, Math.floor(nCtx * 0.2)); // room kept free for the final report
88
- let transcript = firstPrompt(system, question), calls = 0, step = 0, t0 = performance.now(), genTokens = 0, ctxTokens = await engine.countTokens(transcript), wrapUp = false;
 
89
 
90
  // One streamed generation from `prompt` into `card`; returns the raw text and how it ended.
91
  async function generate(prompt, card, sampling) {
 
85
  const { engine, system } = await loadEngine();
86
  if (aborted) { status('Stopped.', 0); return; }
87
  const nCtx = Math.min(CTX, engine.nCtx || CTX), RESERVE = Math.min(6000, Math.floor(nCtx * 0.2)); // room kept free for the final report
88
+ const today = q.get('date') === '0' ? '' : `\n\nToday's date is ${new Date().toLocaleDateString('en-CA')}.`; // not in Ai2's prompt: without it the model assumes its training year and searches for stale news
89
+ let transcript = firstPrompt(system + today, question), calls = 0, step = 0, t0 = performance.now(), genTokens = 0, ctxTokens = await engine.countTokens(transcript), wrapUp = false;
90
 
91
  // One streamed generation from `prompt` into `card`; returns the raw text and how it ended.
92
  async function generate(prompt, card, sampling) {
style.css CHANGED
@@ -9,6 +9,8 @@
9
  }
10
  * { box-sizing: border-box; }
11
  html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
 
 
12
  main { display: grid; gap: 10px; padding: 10px 12px 24px; max-width: 860px; margin: 0 auto; }
13
  #line { margin: 0; font-size: 14px; color: var(--muted); }
14
  #line b { color: var(--ink); }
 
9
  }
10
  * { box-sizing: border-box; }
11
  html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
12
+ html { height: 100%; overflow: hidden; }
13
+ body { height: 100%; overflow-y: auto; overscroll-behavior: contain; } /* body is the scroller: wheel scrolling also works when the Space's iframe does not scroll its document */
14
  main { display: grid; gap: 10px; padding: 10px 12px 24px; max-width: 860px; margin: 0 auto; }
15
  #line { margin: 0; font-size: 14px; color: var(--muted); }
16
  #line b { color: var(--ink); }