Spaces:
Runtime error
Runtime error
Commit
•
ba89a72
1
Parent(s):
5404292
Update app.py
Browse files
app.py
CHANGED
@@ -822,7 +822,6 @@ COLS = [col.name for col in DATA_OVERALL_COLUMN_TO_DATATYPE]
|
|
822 |
TYPES = [col.type for col in DATA_OVERALL_COLUMN_TO_DATATYPE]
|
823 |
|
824 |
data_overall = gr.components.Dataframe(
|
825 |
-
DATA_OVERALL,
|
826 |
headers=COLS,
|
827 |
datatype=TYPES,
|
828 |
visible=False,
|
@@ -832,19 +831,9 @@ data_overall = gr.components.Dataframe(
|
|
832 |
print(data_overall)
|
833 |
|
834 |
def display(x, y):
|
835 |
-
global
|
836 |
-
|
837 |
-
# Check if leaderboard_table is indeed a DataFrame
|
838 |
-
if isinstance(data_overall, pd.DataFrame):
|
839 |
-
for column in data_overall.columns:
|
840 |
-
if data_overall[column].dtype == 'object':
|
841 |
-
data_overall[column] = data_overall[column].apply(remove_invalid_unicode)
|
842 |
|
843 |
-
# Ensure COLS is defined and valid; it's used to filter columns in the DataFrame
|
844 |
-
subset_df = data_overall[COLS] # Assuming COLS is a list of column names you want to keep
|
845 |
-
return subset_df
|
846 |
-
else:
|
847 |
-
print("leaderboard_table is not a DataFrame.")
|
848 |
|
849 |
dummy1 = gr.Textbox(visible=False)
|
850 |
|
|
|
822 |
TYPES = [col.type for col in DATA_OVERALL_COLUMN_TO_DATATYPE]
|
823 |
|
824 |
data_overall = gr.components.Dataframe(
|
|
|
825 |
headers=COLS,
|
826 |
datatype=TYPES,
|
827 |
visible=False,
|
|
|
831 |
print(data_overall)
|
832 |
|
833 |
def display(x, y):
|
834 |
+
global DATA_OVERALL # Ensure we're accessing the global variable
|
835 |
+
return DATA_OVERALL
|
|
|
|
|
|
|
|
|
|
|
836 |
|
|
|
|
|
|
|
|
|
|
|
837 |
|
838 |
dummy1 = gr.Textbox(visible=False)
|
839 |
|