raktimhugging commited on
Commit
ad9d517
Β·
verified Β·
1 Parent(s): 0f0cf1c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -9
app.py CHANGED
@@ -456,8 +456,8 @@ def get_stats_api():
456
  "search_capabilities": ["Error"]
457
  }
458
 
459
- def chat_interface(message, history):
460
- """Chat interface with hybrid search"""
461
  if not message.strip():
462
  return "Please ask me something about Raktim Mondol! I use hybrid search combining semantic similarity and keyword matching for the best results."
463
 
@@ -511,16 +511,36 @@ def chat_interface(message, history):
511
  # Create Gradio interfaces with proper API names
512
  print("Creating Gradio interface...")
513
 
514
- # Main chat interface
515
  chat_demo = gr.Interface(
516
  fn=chat_interface,
517
- inputs=[
518
- gr.Textbox(label="Ask about Raktim Mondol", placeholder="What would you like to know about Raktim's research, skills, or experience?"),
519
- gr.State([]) # For conversation history
520
- ],
521
- outputs=gr.Textbox(label="Response"),
 
 
 
 
 
522
  title="πŸ”₯ Hybrid Search RAGtim Bot",
523
- description="Ask me anything about Raktim Mondol! I use advanced hybrid search combining semantic similarity and keyword matching.",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
524
  api_name="chat"
525
  )
526
 
 
456
  "search_capabilities": ["Error"]
457
  }
458
 
459
+ def chat_interface(message: str) -> str:
460
+ """Simple chat interface without state management"""
461
  if not message.strip():
462
  return "Please ask me something about Raktim Mondol! I use hybrid search combining semantic similarity and keyword matching for the best results."
463
 
 
511
  # Create Gradio interfaces with proper API names
512
  print("Creating Gradio interface...")
513
 
514
+ # Main chat interface - simplified without state
515
  chat_demo = gr.Interface(
516
  fn=chat_interface,
517
+ inputs=gr.Textbox(
518
+ label="Ask about Raktim Mondol",
519
+ placeholder="What would you like to know about Raktim's research, skills, or experience?",
520
+ lines=2
521
+ ),
522
+ outputs=gr.Textbox(
523
+ label="Response",
524
+ lines=15,
525
+ max_lines=20
526
+ ),
527
  title="πŸ”₯ Hybrid Search RAGtim Bot",
528
+ description=f"""
529
+ **πŸš€ Hybrid Search System**: This Space implements **true hybrid search** combining:
530
+ - 🧠 **Semantic Vector Search**: Transformer embeddings for conceptual similarity
531
+ - πŸ” **BM25 Keyword Search**: Advanced TF-IDF ranking for exact term matching
532
+ - βš–οΈ **Intelligent Fusion**: Weighted combination for optimal relevance
533
+
534
+ **πŸ“š Knowledge Base**: **{len(bot.knowledge_base)} sections** from comprehensive markdown files
535
+
536
+ **Ask me anything about Raktim Mondol's research, expertise, and background!**
537
+ """,
538
+ examples=[
539
+ "What is Raktim's LLM and RAG research?",
540
+ "Tell me about BioFusionNet statistical methods",
541
+ "What are his multimodal AI capabilities?",
542
+ "Describe his biostatistics expertise"
543
+ ],
544
  api_name="chat"
545
  )
546