Spaces:
Sleeping
Sleeping
Joschka Strueber
commited on
Commit
·
b3306d0
1
Parent(s):
4adb140
[Fix] rendering issues
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import plotly.graph_objects as go
|
|
| 3 |
import numpy as np
|
| 4 |
from src.dataloading import get_leaderboard_models_cached, get_leaderboard_datasets
|
| 5 |
|
| 6 |
-
# Force
|
| 7 |
import plotly.io as pio
|
| 8 |
pio.renderers.default = "iframe"
|
| 9 |
|
|
@@ -35,7 +35,6 @@ def create_heatmap(selected_models, selected_dataset):
|
|
| 35 |
margin=dict(l=100, r=100, t=100, b=100)
|
| 36 |
)
|
| 37 |
|
| 38 |
-
# (Optional) Force categorical ordering explicitly
|
| 39 |
fig.update_xaxes(
|
| 40 |
type="category",
|
| 41 |
categoryorder="array",
|
|
@@ -50,8 +49,8 @@ def create_heatmap(selected_models, selected_dataset):
|
|
| 50 |
automargin=True
|
| 51 |
)
|
| 52 |
|
| 53 |
-
# Return
|
| 54 |
-
return fig
|
| 55 |
|
| 56 |
def validate_inputs(selected_models, selected_dataset):
|
| 57 |
if not selected_models:
|
|
@@ -98,4 +97,5 @@ with gr.Blocks(title="LLM Similarity Analyzer") as demo:
|
|
| 98 |
)
|
| 99 |
|
| 100 |
if __name__ == "__main__":
|
|
|
|
| 101 |
demo.launch(ssr_mode=False)
|
|
|
|
| 3 |
import numpy as np
|
| 4 |
from src.dataloading import get_leaderboard_models_cached, get_leaderboard_datasets
|
| 5 |
|
| 6 |
+
# Force Plotly to use the iframe renderer
|
| 7 |
import plotly.io as pio
|
| 8 |
pio.renderers.default = "iframe"
|
| 9 |
|
|
|
|
| 35 |
margin=dict(l=100, r=100, t=100, b=100)
|
| 36 |
)
|
| 37 |
|
|
|
|
| 38 |
fig.update_xaxes(
|
| 39 |
type="category",
|
| 40 |
categoryorder="array",
|
|
|
|
| 49 |
automargin=True
|
| 50 |
)
|
| 51 |
|
| 52 |
+
# Return the Plotly figure object directly
|
| 53 |
+
return fig
|
| 54 |
|
| 55 |
def validate_inputs(selected_models, selected_dataset):
|
| 56 |
if not selected_models:
|
|
|
|
| 97 |
)
|
| 98 |
|
| 99 |
if __name__ == "__main__":
|
| 100 |
+
# Disable SSR to force client-side rendering on Spaces
|
| 101 |
demo.launch(ssr_mode=False)
|