David Tang commited on
Commit
043c14c
·
1 Parent(s): 5a791fc

mobile responsive fix

Browse files
Files changed (2) hide show
  1. app.py +5 -6
  2. assets/custom.css +9 -0
app.py CHANGED
@@ -30,6 +30,10 @@ async def call_my_api(message, history, image=None):
30
  image_obj = message["files"][0] if message["files"] else None
31
  else:
32
  image_obj = image
 
 
 
 
33
  image_base64 = encode_image_to_base64(image_obj) if image_obj else None
34
 
35
  payload = {
@@ -119,11 +123,6 @@ with gr.Blocks(
119
  "assets/brain.svg"]
120
  )
121
 
122
- gr.Markdown(
123
- "Ask me anything about a medical condition.<br><br>You can also upload an medical image to get more information.",
124
- elem_id="main-instructions"
125
- )
126
-
127
  gr.Markdown(
128
  """
129
  <div class='disclaimer-box'>
@@ -131,7 +130,7 @@ with gr.Blocks(
131
  <strong>Medical Disclaimer:</strong> This AI assistant is designed for educational and informational purposes only.
132
  It does not constitute medical advice, diagnosis, or treatment. Always consult with qualified healthcare professionals
133
  for medical decisions. This tool aims to promote health literacy and empower individuals to better understand their
134
- health, but should not replace professional medical consultation.
135
  </p>
136
  </div>
137
  """,
 
30
  image_obj = message["files"][0] if message["files"] else None
31
  else:
32
  image_obj = image
33
+
34
+ if isinstance(image_obj, str):
35
+ image_obj = Image.open(image_obj)
36
+
37
  image_base64 = encode_image_to_base64(image_obj) if image_obj else None
38
 
39
  payload = {
 
123
  "assets/brain.svg"]
124
  )
125
 
 
 
 
 
 
126
  gr.Markdown(
127
  """
128
  <div class='disclaimer-box'>
 
130
  <strong>Medical Disclaimer:</strong> This AI assistant is designed for educational and informational purposes only.
131
  It does not constitute medical advice, diagnosis, or treatment. Always consult with qualified healthcare professionals
132
  for medical decisions. This tool aims to promote health literacy and empower individuals to better understand their
133
+ health, but should not replace professional medical consultation. See below link for more on the technical details.
134
  </p>
135
  </div>
136
  """,
assets/custom.css CHANGED
@@ -128,4 +128,13 @@ body.light .disclaimer-box {
128
  body.light #docs-demo {
129
  background: rgba(248,249,250,0.95);
130
  color: #23262f;
 
 
 
 
 
 
 
 
 
131
  }
 
128
  body.light #docs-demo {
129
  background: rgba(248,249,250,0.95);
130
  color: #23262f;
131
+ }
132
+
133
+ @media (max-width: 600px) {
134
+ .nav-holder {
135
+ margin-bottom: 24px;
136
+ }
137
+ main.app {
138
+ padding-top: 24px;
139
+ }
140
  }