Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -456,8 +456,8 @@ def get_stats_api():
|
|
456 |
"search_capabilities": ["Error"]
|
457 |
}
|
458 |
|
459 |
-
def chat_interface(message
|
460 |
-
"""
|
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 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
|
|
|
|
|
|
|
|
|
|
522 |
title="π₯ Hybrid Search RAGtim Bot",
|
523 |
-
description="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|