mzidan000 commited on
Commit
5fcae20
·
verified ·
1 Parent(s): 5ad9595

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +5 -18
index.html CHANGED
@@ -279,17 +279,10 @@ const EXAMPLES = [
279
  ];
280
  document.getElementById("prompt").value = EXAMPLES[0];
281
 
282
- // Phased progress messages (frontend-driven, carry perceived progress while the
283
- // backend stream is silent during the Modal cold-start gap).
284
- const PHASES = [
285
- {t:0, m:"Reading your trip request…"},
286
- {t:4, m:"🤖 Nemotron is choosing the right tools…"},
287
- {t:14, m:"✈️ Scanning airlines for the cheapest route…"},
288
- {t:30, m:"🏨 Finding hotels closest to BC Place…"},
289
- {t:48, m:"🌤️ Checking the match-day forecast…"},
290
- {t:68, m:"🗺️ Scoring 3 packages & ranking them…"},
291
- {t:95, m:"✍️ Nemotron is writing your comparison…"},
292
- ];
293
 
294
  let running = false;
295
  let resultHandled = false; // the result event repeats on `complete` — render once
@@ -366,13 +359,7 @@ function startTimer(bubble){
366
  elapsedTimer = setInterval(()=>{
367
  const secs = Math.floor((performance.now()-t0)/1000);
368
  setElapsed(bubble, secs);
369
- // phased fallback if no real event recently
370
- if (performance.now() - lastRealAt > 6000){
371
- let ph = PHASES[0].m;
372
- for (const p of PHASES){ if (secs >= p.t) ph = p.m; }
373
- setStatus(bubble, ph);
374
- }
375
- // cold-start honesty after ~20s
376
  const hint = document.querySelector(".cold-hint");
377
  if (hint && secs >= 20 && hint.dataset.shown !== "1"){
378
  hint.dataset.shown = "1";
 
279
  ];
280
  document.getElementById("prompt").value = EXAMPLES[0];
281
 
282
+ // NOTE: status text is driven ONLY by real stream events (the backend's _pulse
283
+ // sends an accurate commentary heartbeat every ~9s during any long phase). The
284
+ // timer below drives the elapsed counter + cold-start hint only — it does NOT
285
+ // invent phase messages, which would be inaccurate when round 1 runs long.
 
 
 
 
 
 
 
286
 
287
  let running = false;
288
  let resultHandled = false; // the result event repeats on `complete` — render once
 
359
  elapsedTimer = setInterval(()=>{
360
  const secs = Math.floor((performance.now()-t0)/1000);
361
  setElapsed(bubble, secs);
362
+ // cold-start honesty after ~20s (status text itself comes from real events)
 
 
 
 
 
 
363
  const hint = document.querySelector(".cold-hint");
364
  if (hint && secs >= 20 && hint.dataset.shown !== "1"){
365
  hint.dataset.shown = "1";