Spaces:
Running on CPU Upgrade

lunarflu HF staff commited on
Commit
342106b
·
verified ·
1 Parent(s): 11093dc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -6
app.py CHANGED
@@ -710,15 +710,21 @@ def get_data2():
710
  demo = gr.Blocks()
711
  with demo:
712
  try:
713
- dataframe1 = pd.read_csv('https://docs.google.com/spreadsheets/d/1C8aLqgCqLYcMiIFf-P_Aosaa03C_WLIB_UyqvjSdWg8/export?format=csv&gid=0')
 
714
  column_values_unique = sorted(dataframe1.iloc[:, 3].unique())
 
715
  dataframe2 = pd.DataFrame({'Levels': column_values_unique})
 
716
  counts = {}
717
- for value in data.iloc[:, 3]:
718
- counts[value] = counts.get(value, 0) + 1
719
- dataframe2['Members'] = dataframe2['Levels'].map(counts)
720
-
721
- print("\nDataframe 2:")
 
 
 
722
  print(dataframe2)
723
 
724
  TITLE = """<h1 align="center" id="space-title">🤗 Hugging Face Level Leaderboard</h1>"""
 
710
  demo = gr.Blocks()
711
  with demo:
712
  try:
713
+ dataframe1 = global_df.copy()
714
+ print(dataframe1)
715
  column_values_unique = sorted(dataframe1.iloc[:, 3].unique())
716
+ print(column_values_unique)
717
  dataframe2 = pd.DataFrame({'Levels': column_values_unique})
718
+ print(dataframe2)
719
  counts = {}
720
+ try:
721
+ for value in data.iloc[:, 3]:
722
+ print(value)
723
+ print(type(value))
724
+ counts[value] = counts.get(value, 0) + 1
725
+ dataframe2['Members'] = dataframe2['Levels'].map(counts)
726
+ except Exception as e:
727
+ print(f"dataframe2 Error: {e}")
728
  print(dataframe2)
729
 
730
  TITLE = """<h1 align="center" id="space-title">🤗 Hugging Face Level Leaderboard</h1>"""