Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import pandas as pd
|
| 3 |
import numpy as np
|
|
@@ -5,6 +7,18 @@ from functools import partial
|
|
| 5 |
from gradio_rangeslider import RangeSlider
|
| 6 |
from datetime import datetime, timedelta
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
custom_css = """
|
| 9 |
.tab-nav button {
|
| 10 |
font-size: 18px !important;
|
|
@@ -138,7 +152,7 @@ with GraInter:
|
|
| 138 |
<a href="mailto:ugi.leaderboard@gmail.com" target="_blank" class="default-underline">Contact/Model Requests</a> (or create a HF discussion)
|
| 139 |
</div>
|
| 140 |
<div>
|
| 141 |
-
|
| 142 |
</div>
|
| 143 |
</div>
|
| 144 |
<div style="display: flex; flex-direction: column; align-items: center; margin-top: 20px;">
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import base64
|
| 3 |
import gradio as gr
|
| 4 |
import pandas as pd
|
| 5 |
import numpy as np
|
|
|
|
| 7 |
from gradio_rangeslider import RangeSlider
|
| 8 |
from datetime import datetime, timedelta
|
| 9 |
|
| 10 |
+
# Encode kofi_button.png
|
| 11 |
+
current_dir = os.path.dirname(os.path.realpath(__file__))
|
| 12 |
+
with open(os.path.join(current_dir, "Images/kofi_button.png"), "rb") as image_file:
|
| 13 |
+
kofi_button = base64.b64encode(image_file.read()).decode('utf-8')
|
| 14 |
+
|
| 15 |
+
# Create the HTML for the kofi button
|
| 16 |
+
KOFI_BUTTON_HTML = f"""
|
| 17 |
+
<a href="https://ko-fi.com/dontplantoend" target="_blank">
|
| 18 |
+
<img src="data:image/png;base64,{kofi_button}" style="width:150px;display:block;margin-left:auto;margin-right:auto">
|
| 19 |
+
</a>
|
| 20 |
+
"""
|
| 21 |
+
|
| 22 |
custom_css = """
|
| 23 |
.tab-nav button {
|
| 24 |
font-size: 18px !important;
|
|
|
|
| 152 |
<a href="mailto:ugi.leaderboard@gmail.com" target="_blank" class="default-underline">Contact/Model Requests</a> (or create a HF discussion)
|
| 153 |
</div>
|
| 154 |
<div>
|
| 155 |
+
""" + KOFI_BUTTON_HTML + """
|
| 156 |
</div>
|
| 157 |
</div>
|
| 158 |
<div style="display: flex; flex-direction: column; align-items: center; margin-top: 20px;">
|