Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -173,6 +173,26 @@ doctor_dashboard_interface = gr.Interface(
|
|
173 |
outputs="text",
|
174 |
)
|
175 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
# Gradio App Layout
|
177 |
with gr.Blocks() as app:
|
178 |
gr.Markdown("# Medico GPT")
|
@@ -200,5 +220,8 @@ with gr.Blocks() as app:
|
|
200 |
|
201 |
with gr.Tab("Doctor Dashboard"):
|
202 |
doctor_dashboard_interface.render()
|
|
|
|
|
|
|
203 |
|
204 |
app.launch(share=True)
|
|
|
173 |
outputs="text",
|
174 |
)
|
175 |
|
176 |
+
# Use a pipeline as a high-level helper
|
177 |
+
from transformers import pipeline
|
178 |
+
|
179 |
+
# Load the doctor consultant model
|
180 |
+
doctor_consultant = pipeline("text-generation", model="ahmed-7124/dgptAW")
|
181 |
+
|
182 |
+
# New function for Doctor Consultant (Text Generation for Consultation)
|
183 |
+
def doctor_consultation(query):
|
184 |
+
response = doctor_consultant(query, max_length=200, num_return_sequences=1)
|
185 |
+
return response[0]['generated_text']
|
186 |
+
|
187 |
+
# Adding the doctor consultant interface to Gradio
|
188 |
+
doctor_consultation_interface = gr.Interface(
|
189 |
+
fn=doctor_consultation,
|
190 |
+
inputs=gr.Textbox(label="Ask the Doctor (Consultation Query)", placeholder="Enter your medical query here..."),
|
191 |
+
outputs="text",
|
192 |
+
title="Doctor Consultant",
|
193 |
+
description="Get expert advice from the Doctor Consultant powered by AI. Ask any medical-related questions and get responses."
|
194 |
+
)
|
195 |
+
|
196 |
# Gradio App Layout
|
197 |
with gr.Blocks() as app:
|
198 |
gr.Markdown("# Medico GPT")
|
|
|
220 |
|
221 |
with gr.Tab("Doctor Dashboard"):
|
222 |
doctor_dashboard_interface.render()
|
223 |
+
|
224 |
+
with gr.Tab("Doctor Consultant"):
|
225 |
+
doctor_consultation_interface.render()
|
226 |
|
227 |
app.launch(share=True)
|