Update app.py
Browse files
app.py
CHANGED
|
@@ -34,7 +34,7 @@ if hasattr(transformers_import_utils, "is_cuda_stream_capturing"):
|
|
| 34 |
|
| 35 |
# 1. Initialize LLM
|
| 36 |
print("Loading BioMistral LLM...")
|
| 37 |
-
llm = pipeline('text-generation', model='BioMistral/BioMistral-7B', torch_dtype=torch.bfloat16, device_map="
|
| 38 |
|
| 39 |
# 2. Load Datasets
|
| 40 |
print("Loading datasets...")
|
|
@@ -132,9 +132,9 @@ def respond_to_query(user_query: str) -> str:
|
|
| 132 |
# 9. Gradio Web Interface
|
| 133 |
demo = gr.Interface(
|
| 134 |
fn=respond_to_query,
|
| 135 |
-
inputs=gr.Textbox(lines=2, placeholder="e.g., What is necrosis? or What is cholera?"),
|
| 136 |
outputs=gr.Textbox(label="BioMistral RAG Response", lines=4),
|
| 137 |
-
title="
|
| 138 |
description="Ask a medical question to retrieve context from Med-EASi + custom terms and generate simplified explanations.",
|
| 139 |
examples=[
|
| 140 |
["What causes necrosis?"],
|
|
|
|
| 34 |
|
| 35 |
# 1. Initialize LLM
|
| 36 |
print("Loading BioMistral LLM...")
|
| 37 |
+
llm = pipeline('text-generation', model='BioMistral/BioMistral-7B', torch_dtype=torch.bfloat16, device_map="cuda")
|
| 38 |
|
| 39 |
# 2. Load Datasets
|
| 40 |
print("Loading datasets...")
|
|
|
|
| 132 |
# 9. Gradio Web Interface
|
| 133 |
demo = gr.Interface(
|
| 134 |
fn=respond_to_query,
|
| 135 |
+
inputs=gr.Textbox(lines=2, label="User Question", placeholder="e.g., What is necrosis? or What is cholera?"),
|
| 136 |
outputs=gr.Textbox(label="BioMistral RAG Response", lines=4),
|
| 137 |
+
title="Medical Terminology RAG Assistant",
|
| 138 |
description="Ask a medical question to retrieve context from Med-EASi + custom terms and generate simplified explanations.",
|
| 139 |
examples=[
|
| 140 |
["What causes necrosis?"],
|