lunarflu HF staff commited on
Commit
0bd62bc
1 Parent(s): e088500

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -11
app.py CHANGED
@@ -708,17 +708,14 @@ demo = gr.Blocks()
708
  with demo:
709
  try:
710
  dataframe1 = pd.read_csv("https://docs.google.com/spreadsheets/d/1C8aLqgCqLYcMiIFf-P_Aosaa03C_WLIB_UyqvjSdWg8/export?format=csv&gid=0") # required for timing
711
- column_values_unique = sorted(dataframe1.iloc[:, 3].unique())
712
- dataframe2 = pd.DataFrame({'Levels': column_values_unique})
713
-
714
- counts = {}
715
- try:
716
- for value in test_merge.iloc[:, 3]:
717
- counts[value] = counts.get(value, 0) + 1
718
- dataframe2['Members'] = dataframe2['Levels'].map(counts)
719
- except Exception as e:
720
- print(f"gradio display error Error: {e}")
721
- print(f"dataframe2: {dataframe2}")
722
 
723
  TITLE = """<h1 align="center" id="space-title">🤗 Hugging Face Level Leaderboard</h1>"""
724
  gr.HTML(TITLE)
 
708
  with demo:
709
  try:
710
  dataframe1 = pd.read_csv("https://docs.google.com/spreadsheets/d/1C8aLqgCqLYcMiIFf-P_Aosaa03C_WLIB_UyqvjSdWg8/export?format=csv&gid=0") # required for timing
711
+ print(dataframe1)
712
+
713
+ level_counts = dataframe1['discord_level'].value_counts().sort_index()
714
+ dataframe2 = pd.DataFrame({
715
+ 'Levels': level_counts.index,
716
+ 'Members': level_counts.values
717
+ })
718
+ print(dataframe2)
 
 
 
719
 
720
  TITLE = """<h1 align="center" id="space-title">🤗 Hugging Face Level Leaderboard</h1>"""
721
  gr.HTML(TITLE)