Spaces:
Running
Running
Refactor css_html_js.py to update Font Awesome version
Browse files- app.py +5 -2
- src/display/css_html_js.py +7 -2
- src/envs.py +2 -0
app.py
CHANGED
@@ -21,6 +21,7 @@ from src.about import (
|
|
21 |
from src.display.css_html_js import (
|
22 |
custom_css,
|
23 |
CSS_EXTERNAL,
|
|
|
24 |
)
|
25 |
from src.display.utils import (
|
26 |
AutoEvalColumn,
|
@@ -153,10 +154,12 @@ HEAD = "".join(
|
|
153 |
[
|
154 |
f'<link rel="stylesheet" href="{css}">' for css in CSS_EXTERNAL
|
155 |
]
|
|
|
|
|
|
|
|
|
156 |
)
|
157 |
|
158 |
-
print("HEAD:", HEAD)
|
159 |
-
|
160 |
demo = gr.Blocks(css=custom_css, head = HEAD)
|
161 |
with demo:
|
162 |
gr.HTML(TITLE)
|
|
|
21 |
from src.display.css_html_js import (
|
22 |
custom_css,
|
23 |
CSS_EXTERNAL,
|
24 |
+
JS_EXTERNAL,
|
25 |
)
|
26 |
from src.display.utils import (
|
27 |
AutoEvalColumn,
|
|
|
154 |
[
|
155 |
f'<link rel="stylesheet" href="{css}">' for css in CSS_EXTERNAL
|
156 |
]
|
157 |
+
+
|
158 |
+
[
|
159 |
+
f'<script src="{js}" crossorigin="anonymous"></script>' for js in JS_EXTERNAL
|
160 |
+
]
|
161 |
)
|
162 |
|
|
|
|
|
163 |
demo = gr.Blocks(css=custom_css, head = HEAD)
|
164 |
with demo:
|
165 |
gr.HTML(TITLE)
|
src/display/css_html_js.py
CHANGED
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
1 |
custom_css = """
|
2 |
|
3 |
.markdown-text {
|
@@ -108,6 +111,8 @@ get_window_url_params = """
|
|
108 |
"""
|
109 |
|
110 |
CSS_EXTERNAL = [
|
111 |
-
|
112 |
-
|
|
|
|
|
113 |
]
|
|
|
1 |
+
from src.envs import FONTAWESOME_KIT
|
2 |
+
|
3 |
+
|
4 |
custom_css = """
|
5 |
|
6 |
.markdown-text {
|
|
|
111 |
"""
|
112 |
|
113 |
CSS_EXTERNAL = [
|
114 |
+
]
|
115 |
+
|
116 |
+
JS_EXTERNAL = [
|
117 |
+
f"https://kit.fontawesome.com/{FONTAWESOME_KIT}.js"
|
118 |
]
|
src/envs.py
CHANGED
@@ -25,3 +25,5 @@ EVAL_REQUESTS_PATH_BACKEND = os.path.join(CACHE_PATH, "eval-queue-bk")
|
|
25 |
EVAL_RESULTS_PATH_BACKEND = os.path.join(CACHE_PATH, "eval-results-bk")
|
26 |
|
27 |
API = HfApi(token=TOKEN)
|
|
|
|
|
|
25 |
EVAL_RESULTS_PATH_BACKEND = os.path.join(CACHE_PATH, "eval-results-bk")
|
26 |
|
27 |
API = HfApi(token=TOKEN)
|
28 |
+
|
29 |
+
FONTAWESOME_KIT = os.getenv("FONTAWESOME_KIT", None)
|