Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -63,31 +63,7 @@ iface = gr.Interface(
|
|
63 |
|
64 |
iface.launch()
|
65 |
'''
|
66 |
-
css = """
|
67 |
-
#content_align {
|
68 |
-
text-align: center;
|
69 |
-
padding: 20px;
|
70 |
-
background-color: #282c34;
|
71 |
-
color: #fff;
|
72 |
-
font-family: Arial, sans-serif;
|
73 |
-
}
|
74 |
|
75 |
-
input[type="text"] {
|
76 |
-
padding: 6px;
|
77 |
-
width: 100%;
|
78 |
-
box-sizing: border-box;
|
79 |
-
margin-top: 6px;
|
80 |
-
margin-bottom: 16px;
|
81 |
-
resize: vertical;
|
82 |
-
}
|
83 |
-
"""
|
84 |
-
|
85 |
-
welcome_message = '''
|
86 |
-
<div id="content_align">
|
87 |
-
<h1>AI Medical Chatbot</h1>
|
88 |
-
<p>Ask any medical question and get answers from our AI Medical Chatbot</p>
|
89 |
-
<p>Developed by Ruslan Magana. Visit <a href="https://ruslanmv.com/">https://ruslanmv.com/</a> for more information.</p>
|
90 |
-
</div>
|
91 |
'''
|
92 |
|
93 |
iface = gr.Interface(
|
@@ -104,3 +80,70 @@ iface = gr.Interface(
|
|
104 |
)
|
105 |
|
106 |
iface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
iface.launch()
|
65 |
'''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
'''
|
68 |
|
69 |
iface = gr.Interface(
|
|
|
80 |
)
|
81 |
|
82 |
iface.launch()
|
83 |
+
'''
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
import gradio as gr
|
88 |
+
|
89 |
+
css = """
|
90 |
+
/* General Container Styles */
|
91 |
+
.gradio-container {
|
92 |
+
font-family: "IBM Plex Sans", sans-serif; position: fixed; /* Ensure full-screen coverage */
|
93 |
+
top: 0;
|
94 |
+
left: 0;
|
95 |
+
width: 100vw; /* Set width to 100% viewport width */
|
96 |
+
height: 100vh; /* Set height to 100% viewport height */
|
97 |
+
margin: 0; /* Remove margins for full-screen effect */
|
98 |
+
padding: 0; /* Remove padding fol-screen background */
|
99 |
+
background-color: #212529; /* Dark background color */
|
100 |
+
color: #fff; /* Light text color for better readability */
|
101 |
+
overflow: hidden; /* Hide potential overflow content */
|
102 |
+
background-image: url("https://huggingface.co/spaces/ruslanmv/AI-Medical-Chatbot/resolve/main/notebook/local/img/background.jpg"); /* Replace with your image path */
|
103 |
+
background-size: cover; /* Stretch the image to cover the container */
|
104 |
+
background-position: center; /* Center the image horizontally and vertically */
|
105 |
+
}
|
106 |
+
|
107 |
+
/* Button Styles */
|
108 |
+
.gr-button {
|
109 |
+
color: white;
|
110 |
+
background: #007bff; /* Use a primary color for the background */
|
111 |
+
white-space: nowrap;
|
112 |
+
border: none;
|
113 |
+
padding: 10px 20px;
|
114 |
+
border-radius: 8px;
|
115 |
+
cursor: pointer;
|
116 |
+
transition: background-color 0.3s, color 0.3s;
|
117 |
+
}
|
118 |
+
.gr-button:hover {
|
119 |
+
background-color: #0056b3; /* Darken the background color on hover */
|
120 |
+
}
|
121 |
+
|
122 |
+
/* Output box styles */
|
123 |
+
.gradio-textbox {
|
124 |
+
background-color: #343a40; /* Dark background color */
|
125 |
+
color: #fff; /* Light text color for better readability */
|
126 |
+
border-color: #343a40; /* Dark border color */
|
127 |
+
border-radius: 8px;
|
128 |
+
}
|
129 |
+
"""
|
130 |
+
|
131 |
+
welcome_message = """# AI Medical Chatbot
|
132 |
+
Ask any medical question and get answers from our AI Medical Chatbot
|
133 |
+
Developed by Ruslan Magana. Visit [https://ruslanmv.com/](https://ruslanmv.com/) for more information."""
|
134 |
+
|
135 |
+
|
136 |
+
with gr.Blocks(css=css) as interface:
|
137 |
+
gr.Markdown(welcome_message) # Display the welcome message
|
138 |
+
|
139 |
+
with gr.Row():
|
140 |
+
with gr.Column():
|
141 |
+
symptoms_input = gr.Textbox(label="Symptoms", placeholder="Enter symptoms here")
|
142 |
+
question_input = gr.Textbox(label="Question", placeholder="Enter question here")
|
143 |
+
generate_button = gr.Button("Ask Me", variant="primary")
|
144 |
+
|
145 |
+
with gr.Row():
|
146 |
+
answer_output = gr.Textbox(type="text", label="Answer")
|
147 |
+
|
148 |
+
interface.launch()
|
149 |
+
|