Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import docs
|
| 3 |
+
|
| 4 |
+
async def call_my_api(message, history):
|
| 5 |
+
return f"Response to: {message}"
|
| 6 |
+
|
| 7 |
+
with gr.Blocks(
|
| 8 |
+
theme=gr.themes.Soft(
|
| 9 |
+
primary_hue="blue",
|
| 10 |
+
secondary_hue="blue",
|
| 11 |
+
neutral_hue="slate",
|
| 12 |
+
font=["Inter", "sans-serif"],
|
| 13 |
+
),
|
| 14 |
+
title="Agent medGemma"
|
| 15 |
+
) as demo:
|
| 16 |
+
chatbot = gr.Chatbot(
|
| 17 |
+
type="messages",
|
| 18 |
+
height=600
|
| 19 |
+
)
|
| 20 |
+
|
| 21 |
+
with gr.Row():
|
| 22 |
+
with gr.Column(scale=2):
|
| 23 |
+
gr.Markdown("# 🏥 Agent MedGemma")
|
| 24 |
+
with gr.Column(scale=3):
|
| 25 |
+
gr.Markdown(
|
| 26 |
+
"<div>Simple and accessible medical facts</div>"
|
| 27 |
+
)
|
| 28 |
+
|
| 29 |
+
with gr.Row():
|
| 30 |
+
with gr.Column(scale=1):
|
| 31 |
+
chat_interface = gr.ChatInterface(
|
| 32 |
+
fn=call_my_api,
|
| 33 |
+
chatbot=chatbot,
|
| 34 |
+
theme="soft"
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
with demo.route("Technical Documentation", "/docs"):
|
| 38 |
+
docs.tabs_issue.render()
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
if __name__ == "__main__":
|
| 42 |
+
demo.launch()
|