lunarflu HF staff commited on
Commit
5b24125
β€’
1 Parent(s): 295e0b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -35
app.py CHANGED
@@ -324,10 +324,7 @@ async def xp_help(ctx):
324
  # check if members are still in the server
325
 
326
  """"""
327
- def get_data():
328
- first_3_columns = data.iloc[:, 1:4]
329
- first_3_columns.to_csv('first_3_columns.csv', index=False)
330
- return first_3_columns
331
 
332
  # csv
333
  # read into pandas dataframe1
@@ -336,39 +333,8 @@ def get_data():
336
 
337
  demo = gr.Blocks()
338
  with demo:
339
- column_values_unique = sorted(data.iloc[:, 3].unique())
340
- dataframe2 = pd.DataFrame({'Levels': column_values_unique})
341
- counts = {}
342
- for value in data.iloc[:, 3]:
343
- counts[value] = counts.get(value, 0) + 1
344
- dataframe2['Members'] = dataframe2['Levels'].map(counts)
345
-
346
- print("\nDataframe 2:")
347
- print(dataframe2)
348
-
349
  TITLE = """<h1 align="center" id="space-title">πŸ€— Hugging Face Level Leaderboard</h1>"""
350
  gr.HTML(TITLE)
351
- with gr.Tabs(elem_classes="tab-buttons") as tabs:
352
- with gr.TabItem("πŸ… Level leaderboard", elem_id="level-table", id=0):
353
- #gr.Markdown("# πŸ“ˆ Experience Leaderboard")
354
- with gr.Row():
355
- with gr.Column():
356
- gr.DataFrame(get_data, every=5, height=500, interactive=False, col_count=(3, "fixed"), column_widths=["100px","100px","100px"])
357
-
358
- with gr.Column():
359
- gr.BarPlot(
360
- value=dataframe2,
361
- x="Levels",
362
- y="Members",
363
- title="Level Distribution",
364
- height=450,
365
- width=450,
366
- interactive=False
367
- )
368
- #with gr.TabItem("πŸ“ˆ Members of the Week", elem_id="week-table", id=1):
369
-
370
- #with gr.TabItem("πŸ“ˆ Hub-only leaderboard", elem_id="hub-table", id=2):
371
-
372
  demo.queue().launch()
373
 
374
 
 
324
  # check if members are still in the server
325
 
326
  """"""
327
+
 
 
 
328
 
329
  # csv
330
  # read into pandas dataframe1
 
333
 
334
  demo = gr.Blocks()
335
  with demo:
 
 
 
 
 
 
 
 
 
 
336
  TITLE = """<h1 align="center" id="space-title">πŸ€— Hugging Face Level Leaderboard</h1>"""
337
  gr.HTML(TITLE)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
338
  demo.queue().launch()
339
 
340