Pro-Coder commited on
Commit
812fd87
·
verified ·
1 Parent(s): 23c9b7a

Upload 34 files

Browse files
Files changed (1) hide show
  1. app.py +35 -13
app.py CHANGED
@@ -427,10 +427,17 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue"), css=CUSTOM_CSS, title="
427
 
428
  with gr.Tab("💬 AI Assistant"):
429
  gr.HTML(data_badge(
430
- "🧪 <b>You are testing:</b> an LLM chatbot grounded in a 10-article synthetic "
431
- "warehouse-ops knowledge base (RAG), routed by an intent classifier trained on "
432
- "~480 synthetic queries. <b>Data type:</b> hand-written knowledge articles + "
433
- "template-generated questions not real Daifuku data."
 
 
 
 
 
 
 
434
  ))
435
  gr.ChatInterface(
436
  fn=chat_fn,
@@ -451,10 +458,18 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue"), css=CUSTOM_CSS, title="
451
 
452
  with gr.Tab("📦 Inventory & Order Query"):
453
  gr.HTML(data_badge(
454
- f"🧪 <b>You are testing:</b> NL→structured-query search over "
455
- f"{len(inventory_df)} synthetic SKUs and {len(orders_df)} synthetic orders. "
456
- "<b>Data type:</b> randomly generated inventory/order records (fixed seed, "
457
- "reproducible) — a stand-in for a live WMS, not real warehouse data."
 
 
 
 
 
 
 
 
458
  ))
459
  with gr.Row():
460
  inv_input = gr.Textbox(label="Query", placeholder="How many units of SKU-1042 are in Zone B?", scale=4)
@@ -481,10 +496,17 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue"), css=CUSTOM_CSS, title="
481
 
482
  with gr.Tab("⚠️ Predictive Maintenance"):
483
  gr.HTML(data_badge(
484
- "🧪 <b>You are testing:</b> an Isolation Forest anomaly detector for conveyor/"
485
- "crane motor sensors. <b>Data type:</b> 1,000 synthetic sensor readings (900 "
486
- "normal + 100 simulated-fault) across temperature, vibration, current, and belt "
487
- "speed trained unsupervised, not on real Daifuku equipment telemetry."
 
 
 
 
 
 
 
488
  ))
489
  preset_dropdown = gr.Dropdown(
490
  choices=list(ANOMALY_PRESETS.keys()), label="Load a preset reading", value="Normal reading"
@@ -552,4 +574,4 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue"), css=CUSTOM_CSS, title="
552
 
553
 
554
  if __name__ == "__main__":
555
- demo.launch(server_name="0.0.0.0", server_port=int(os.environ.get("PORT", 7860)))
 
427
 
428
  with gr.Tab("💬 AI Assistant"):
429
  gr.HTML(data_badge(
430
+ "🧪 <b>Source:</b> hand-written by the developer 10 original knowledge-base "
431
+ "articles on warehouse operations (AS/RS, AGV/AMR, WMS, sortation, picking, "
432
+ "maintenance, safety) plus ~480 template-generated example queries. Not scraped "
433
+ "or sourced from Daifuku or any real company.<br>"
434
+ "<b>What it describes:</b> generic intralogistics/automation concepts and "
435
+ "operational scenarios (equipment faults, safety incidents, order/inventory "
436
+ "questions) — general domain knowledge, not any specific facility's live data.<br>"
437
+ "<b>Function:</b> answers free-text warehouse-ops questions by first classifying "
438
+ "the query's intent, retrieving the most relevant knowledge-base passage(s) "
439
+ "(RAG), then generating a grounded answer with a hosted LLM — falling back to "
440
+ "showing the retrieved passages directly if no LLM is available."
441
  ))
442
  gr.ChatInterface(
443
  fn=chat_fn,
 
458
 
459
  with gr.Tab("📦 Inventory & Order Query"):
460
  gr.HTML(data_badge(
461
+ f"🧪 <b>Source:</b> randomly generated by the developer's code "
462
+ f"(`src/data_generation.py`, fixed seed) {len(inventory_df)} synthetic SKU "
463
+ f"records and {len(orders_df)} synthetic orders. Not exported from Daifuku or "
464
+ "any real WMS.<br>"
465
+ "<b>What it describes:</b> a stand-in inventory table (SKU, category, zone, "
466
+ "on-hand units, reorder point, unit cost) and orders table (order ID, status, "
467
+ "line count, priority, zone) — realistic in shape and ranges, but fictional "
468
+ "records, not live warehouse data.<br>"
469
+ "<b>Function:</b> classifies whether a query is about inventory or order status, "
470
+ "extracts SKU/order-ID/zone identifiers with regex, and filters the "
471
+ "corresponding table — a lightweight stand-in for a natural-language WMS query "
472
+ "tool."
473
  ))
474
  with gr.Row():
475
  inv_input = gr.Textbox(label="Query", placeholder="How many units of SKU-1042 are in Zone B?", scale=4)
 
496
 
497
  with gr.Tab("⚠️ Predictive Maintenance"):
498
  gr.HTML(data_badge(
499
+ "🧪 <b>Source:</b> randomly generated by the developer's code "
500
+ "(`src/data_generation.py`, fixed seed) 1,000 synthetic sensor readings "
501
+ "(900 normal + 100 simulated-fault). Not logged from real Daifuku equipment.<br>"
502
+ "<b>What it describes:</b> conveyor/crane motor sensor readings temperature, "
503
+ "vibration, current draw, and belt speed — with the 'anomaly' readings modelled "
504
+ "on realistic failure signatures (elevated temp/vibration/current with reduced "
505
+ "belt speed, as seen with bearing wear or motor overload).<br>"
506
+ "<b>Function:</b> an Isolation Forest model trained unsupervised (it never sees "
507
+ "an anomaly label) learns what 'normal' sensor behaviour looks like, then flags "
508
+ "any new reading — like the ones you enter below — that deviates from it, as an "
509
+ "early-warning signal before an unplanned equipment stoppage."
510
  ))
511
  preset_dropdown = gr.Dropdown(
512
  choices=list(ANOMALY_PRESETS.keys()), label="Load a preset reading", value="Normal reading"
 
574
 
575
 
576
  if __name__ == "__main__":
577
+ demo.launch(server_name="0.0.0.0", server_port=int(os.environ.get("PORT", 7860)))