suayptalha commited on
Commit
1275a62
·
verified ·
1 Parent(s): b44067e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -9
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import gradio as gr
2
  from gradio_client import Client
3
 
@@ -198,6 +199,18 @@ css = """
198
  }
199
  """
200
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  with gr.Blocks(css=css) as demo:
202
  gr.Markdown("### TUBITECH # 9694 - Sea Creature Akinator")
203
 
@@ -360,14 +373,7 @@ with gr.Blocks(css=css) as demo:
360
  ]
361
  )
362
 
363
- # Add a fixed icon at the bottom center of the screen using a local file path.
364
- # Ensure that "icon.png" is in the same directory as this script (or adjust the path accordingly).
365
- gr.HTML(
366
- """
367
- <div style="position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%); z-index: 1000;">
368
- <img src="tubitech-su.png" alt="Icon" style="width: 50px; height: auto;">
369
- </div>
370
- """
371
- )
372
 
373
  demo.launch(debug=True, show_error=True)
 
1
+ import base64
2
  import gradio as gr
3
  from gradio_client import Client
4
 
 
199
  }
200
  """
201
 
202
+ # Base64 encode the local icon image.
203
+ with open("tubitech-su.png", "rb") as image_file:
204
+ encoded_string = base64.b64encode(image_file.read()).decode("utf-8")
205
+ icon_data_uri = f"data:image/png;base64,{encoded_string}"
206
+
207
+ # Create the HTML for the fixed icon.
208
+ icon_html = f"""
209
+ <div style="position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%); z-index: 1000;">
210
+ <img src="{icon_data_uri}" alt="Icon" style="width: 50px; height: auto;">
211
+ </div>
212
+ """
213
+
214
  with gr.Blocks(css=css) as demo:
215
  gr.Markdown("### TUBITECH # 9694 - Sea Creature Akinator")
216
 
 
373
  ]
374
  )
375
 
376
+ # Add the fixed icon with the embedded base64 image.
377
+ gr.HTML(icon_html)
 
 
 
 
 
 
 
378
 
379
  demo.launch(debug=True, show_error=True)