agh123 commited on
Commit
d482861
·
1 Parent(s): 157b914

fix: filter out submissions with ts or pp less than 0.01

Browse files
src/components/visualizations.py CHANGED
@@ -2,6 +2,7 @@
2
  Core module for data visualization components.
3
  """
4
 
 
5
  import streamlit as st
6
  import plotly.express as px
7
  import pandas as pd
@@ -647,4 +648,6 @@ def render_device_rankings(df: pd.DataFrame):
647
  )
648
 
649
  except Exception as e:
 
 
650
  st.error(f"Error calculating Glicko-2 rankings: {str(e)}")
 
2
  Core module for data visualization components.
3
  """
4
 
5
+ import traceback
6
  import streamlit as st
7
  import plotly.express as px
8
  import pandas as pd
 
648
  )
649
 
650
  except Exception as e:
651
+ print(f"Error calculating Glicko-2 rankings: {str(e)}")
652
+ print(traceback.format_exc())
653
  st.error(f"Error calculating Glicko-2 rankings: {str(e)}")
src/core/glicko2_ranking.py CHANGED
@@ -79,9 +79,9 @@ def preprocess_benchmark_data(
79
  print(f"Final device count: {filtered_devices}")
80
 
81
  # Print removed devices for verification
82
- print(
83
- f"Removed {set(df['Normalized Device ID'].unique()) - set(filtered_df['Normalized Device ID'].unique())} "
84
- )
85
 
86
  return filtered_df
87
 
@@ -473,7 +473,6 @@ def analyze_device_glicko2_matches(
473
  if d != device_id1
474
  ]
475
 
476
-
477
  # Get normalized scores using the aggregated data
478
  norm_scores = normalize_scores(device_agg)
479
  # print("norm_scores: ", norm_scores)
 
79
  print(f"Final device count: {filtered_devices}")
80
 
81
  # Print removed devices for verification
82
+ # print(
83
+ # f"Removed {set(df['Normalized Device ID'].unique()) - set(filtered_df['Normalized Device ID'].unique())} "
84
+ # )
85
 
86
  return filtered_df
87
 
 
473
  if d != device_id1
474
  ]
475
 
 
476
  # Get normalized scores using the aggregated data
477
  norm_scores = normalize_scores(device_agg)
478
  # print("norm_scores: ", norm_scores)
src/services/firebase.py CHANGED
@@ -76,6 +76,12 @@ def format_leaderboard_data(submissions: List[dict]) -> pd.DataFrame:
76
  if device_info.get("isEmulator", False):
77
  continue
78
 
 
 
 
 
 
 
79
  # Get device ID for iOS devices
80
  device_id = device_info.get("deviceId", "Unknown")
81
  platform = device_info.get("systemName", "Unknown").lower()
@@ -105,8 +111,8 @@ def format_leaderboard_data(submissions: List[dict]) -> pd.DataFrame:
105
  benchmark_result.get("modelNParams", 0)
106
  ),
107
  "Model File Size": benchmark_result.get("modelSize", 0),
108
- "Prompt Processing": round(benchmark_result.get("ppAvg", 0), 2),
109
- "Token Generation": round(benchmark_result.get("tgAvg", 0), 2),
110
  "Memory Usage (%)": benchmark_result.get("peakMemoryUsage", {}).get(
111
  "percentage"
112
  ),
@@ -164,7 +170,10 @@ def format_leaderboard_data(submissions: List[dict]) -> pd.DataFrame:
164
  filtered_df, anomalies = filter_anomalies(
165
  formatted_df, z_threshold=9.0, min_samples=5
166
  )
167
- print("Anomalies: ", anomalies)
 
 
 
168
  return filtered_df
169
 
170
 
 
76
  if device_info.get("isEmulator", False):
77
  continue
78
 
79
+ # Skip if benchmark failed (zero or missing performance metrics)
80
+ pp_avg = benchmark_result.get("ppAvg", 0)
81
+ tg_avg = benchmark_result.get("tgAvg", 0)
82
+ if pp_avg <= 0.01 or tg_avg <= 0.01:
83
+ continue
84
+
85
  # Get device ID for iOS devices
86
  device_id = device_info.get("deviceId", "Unknown")
87
  platform = device_info.get("systemName", "Unknown").lower()
 
111
  benchmark_result.get("modelNParams", 0)
112
  ),
113
  "Model File Size": benchmark_result.get("modelSize", 0),
114
+ "Prompt Processing": round(pp_avg, 2),
115
+ "Token Generation": round(tg_avg, 2),
116
  "Memory Usage (%)": benchmark_result.get("peakMemoryUsage", {}).get(
117
  "percentage"
118
  ),
 
170
  filtered_df, anomalies = filter_anomalies(
171
  formatted_df, z_threshold=9.0, min_samples=5
172
  )
173
+ print(
174
+ "Anomalies: ",
175
+ anomalies[["Device ID", "Model", "Metric", "Value", "Mean", "Std"]],
176
+ )
177
  return filtered_df
178
 
179
 
src/utils/android_device_cache.json CHANGED
@@ -438,5 +438,195 @@
438
  "oneplus:cph2645": "OnePlus 13R",
439
  "alldocube:iplay50 pro": "iPlay50 Pro",
440
  "lge:lg-h930": "V30",
441
- "asus:asus_ai2202": "Zenfone 9"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
442
  }
 
438
  "oneplus:cph2645": "OnePlus 13R",
439
  "alldocube:iplay50 pro": "iPlay50 Pro",
440
  "lge:lg-h930": "V30",
441
+ "asus:asus_ai2202": "Zenfone 9",
442
+ "realme:rmx5011": "realme GT 7 Pro",
443
+ "motorola:moto g(60)": "moto g(60)",
444
+ "motorola:moto g34 5g": "moto g34 5G",
445
+ "samsung:sm-f741n": "Galaxy Z Flip6",
446
+ "xiaomi:redmi note 7 pro": "Redmi Note 7 Pro",
447
+ "vivo:v2250": "V29",
448
+ "xiaomi:25010pn30g": "Xiaomi 15 Ultra",
449
+ "samsung:sm-s916b": "Galaxy S23+",
450
+ "poco:24117rk2cg": "POCO F7 Pro",
451
+ "google:pixel 9a": "Pixel 9a",
452
+ "redmi:2201117tg": "Redmi Note 11",
453
+ "samsung:sm-s921n": "Galaxy S24",
454
+ "samsung:sm-n9860": "Galaxy Note20 Ultra 5G",
455
+ "vivo:v2249": "Y27",
456
+ "xiaomi:2410crp4cg": "Xiaomi Pad 7",
457
+ "itel:itel p661n": "itel P55 5G",
458
+ "redmi:24115ra8ec": "Redmi Note 14 Pro+",
459
+ "redmi:24115ra8eg": "Redmi Note 14 Pro+ 5G",
460
+ "oppo:cph2211": "CPH2211",
461
+ "samsung:sm-f946u": "Galaxy Z Fold5",
462
+ "xiaomi:redmi note 5 pro": "Redmi Note 5 Pro",
463
+ "huawei:clt-l29": "P20 Pro",
464
+ "infinix:infinix x6851b": "NOTE 40 Pro+ 5G",
465
+ "honor:dnp-nx9": "HONOR 400 Pro",
466
+ "doogee:v20pro": "V20Pro",
467
+ "redmi:25053rt47c": "REDMI Turbo 4 Pro",
468
+ "samsung:sm-t295": "Galaxy Tab A (8.0, 2019)",
469
+ "realme:rmx3933": "RMX3993",
470
+ "redmi:23090ra98g": "Redmi Note 13 Pro+ 5G",
471
+ "xiaomi:25042pn24c": "Xiaomi 15S Pro",
472
+ "samsung:sm-s921u": "Galaxy S24",
473
+ "samsung:sm-s9110": "Galaxy S23",
474
+ "samsung:sm-a346e": "Galaxy A34 5G",
475
+ "nothing:a059": "Nothing Phone (3a)",
476
+ "google:pixel 2 xl": "Pixel 2 XL",
477
+ "samsung:sm-g950f": "Galaxy S8",
478
+ "redmi:24090ra29g": "Redmi Note 14 Pro 5G",
479
+ "oneplus:hd1913": "OnePlus 7T Pro",
480
+ "redmi:21091116ai": "Redmi Note 11T 5G",
481
+ "motorola:moto g84 5g": "moto g84 5G",
482
+ "samsung:sm-f731u": "Galaxy Z Flip5",
483
+ "oneplus:cph2691": "OnePlus 13R",
484
+ "hmd:hmd skyline": "HMD Skyline",
485
+ "infinix:infinix x626b": "S4",
486
+ "samsung:sm-g980f": "Galaxy S20",
487
+ "samsung:sm-s936w": "Galaxy S25+",
488
+ "samsung:sm-s901u1": "Galaxy S22",
489
+ "oneplus:opd2203": "OnePlus Pad",
490
+ "poco:2412dpc0ai": "POCO X7 Pro",
491
+ "doogee:t10": "T10",
492
+ "vivo:v2405a": "X200 Pro",
493
+ "xiaomi:24053py09c": "Xiaomi Civi 4",
494
+ "samsung:sm-a336e": "Galaxy A33 5G",
495
+ "redmi:23117ra68g": "Redmi Note 13 Pro",
496
+ "motorola:xt2153-1": "motorola edge s pro",
497
+ "redmi:23078rkd5c": "Redmi K60 Ultra",
498
+ "motorola:xt2201-6": "moto X30 \u5c4f\u4e0b\u6444\u50cf\u7248",
499
+ "samsung:sm-g770u1": "Galaxy S10 Lite",
500
+ "vivo:v2203a": "V2203A",
501
+ "vivo:v2338": "V2338",
502
+ "umidigi:tg2403gba": "G7_Tab_Pro",
503
+ "redmi:2312draabg": "Redmi Note 13 5G",
504
+ "samsung:sm-x826n": "Galaxy Tab S10+ 5G",
505
+ "oppo:cph2671": "Find N5",
506
+ "samsung:sm-x926b": "Galaxy Tab S10 Ultra 5G",
507
+ "motorola:motorola razr 50 ultra": "motorola razr 50 ultra",
508
+ "infinix:infinix x6528": "Infinix HOT 40i",
509
+ "oneplus:kb2001": "OnePlus 8T",
510
+ "samsung:sm-a566b": "Galaxy A56 5G",
511
+ "realme:rmx3708": "realmeGT Neo5 240W",
512
+ "samsung:sm-a145f": "Galaxy A14",
513
+ "samsung:sm-x115": "Galaxy Tab A9",
514
+ "bncf:bpad": "BPad",
515
+ "samsung:sm-g970u": "Galaxy S10e",
516
+ "motorola:moto g(9) plus": "moto g(9) plus",
517
+ "nothing:a059p": "Nothing Phone (3a) Pro",
518
+ "meizu:meizu 21 pro": "meizu 21 PRO",
519
+ "poco:2310fpca4g": "POCO C65",
520
+ "oneplus:gm1903": "OnePlus 7",
521
+ "redmi:2209116ag": "Redmi Note 12 Pro",
522
+ "motorola:motorola edge plus 2023": "motorola edge plus 2023",
523
+ "sony:xq-es72": "Xperia 10 VI",
524
+ "xiaomi:m2007j3sg": "Mi 10T Pro",
525
+ "samsung:sm-s906u1": "Galaxy S22+",
526
+ "samsung:sm-g990b": "Galaxy S21 FE 5G",
527
+ "oneplus:cph2663": "OnePlus Nord 4",
528
+ "samsung:sm-f731b": "Galaxy Z Flip5",
529
+ "xiaomi:2201123g": "Xiaomi 12",
530
+ "vivo:v2254a": "iQOO 11 Pro",
531
+ "samsung:scg10": "Galaxy S21+ 5G",
532
+ "vivo:v2417a": "V2417A",
533
+ "vivo:v2238a": "iQOO Neo7 SE",
534
+ "oppo:cph2625": "Reno12 5G",
535
+ "alldocube:iplay50_mini_pro": "iPlay50_mini_Pro",
536
+ "motorola:motorola razr 2025": "motorola razr 2025",
537
+ "umidigi:mp34": "UMIDIGI A15C",
538
+ "realme:rmx3706": "realmeGT Neo5",
539
+ "oneplus:mt2111": "OnePlus 9RT 5G",
540
+ "samsung:sm-e546b": "Galaxy F54 5G",
541
+ "infinix:infinix x6882": "Infinix HOT 50",
542
+ "redmi:m2004j19c": "Redmi 9",
543
+ "oneplus:cph2647": "OnePlus 13R",
544
+ "samsung:sm-a546u1": "Galaxy A54 5G",
545
+ "poco:22041216g": "POCO X4 GT",
546
+ "motorola:motorola edge 50": "motorola edge 50",
547
+ "lenovo:tb370fu": "Lenovo Tab P12",
548
+ "vivo:v2324ha": "X100s Pro",
549
+ "samsung:sm-g988u1": "Galaxy S20 Ultra 5G",
550
+ "samsung:sm-s921q": "Galaxy S24",
551
+ "infinix:infinix x6837": "Infinix HOT 40 Pro",
552
+ "poco:22041219pg": "POCO M4 5G",
553
+ "samsung:sm-n985f": "Galaxy Note20 Ultra",
554
+ "samsung:sm-x516b": "Galaxy Tab S9 FE 5G",
555
+ "samsung:sm-a705f": "Galaxy A70",
556
+ "samsung:sm-s938u": "Galaxy S25 Ultra",
557
+ "motorola:motorola razr 50": "motorola razr 50",
558
+ "samsung:sm-g781v": "Galaxy S20 FE 5G",
559
+ "samsung:sm-m146b": "Galaxy M14 5G",
560
+ "samsung:sm-m356b": "Galaxy M35 5G",
561
+ "redmi:21091116ug": "Redmi Note 11 Pro+ 5G",
562
+ "samsung:sm-g996w": "Galaxy S21+ 5G",
563
+ "redmi:2312dra50i": "Redmi Note 13 Pro 5G",
564
+ "htc:htc u23 pro": "HTC U23 pro",
565
+ "cubot:kingkong star": "KINGKONG STAR",
566
+ "nokia:nokia c22": "Nokia C22",
567
+ "xiaomi:2210129sg": "Xiaomi 13 Lite",
568
+ "samsung:sm-p613": "Galaxy Tab S6 Lite",
569
+ "motorola:moto g - 2025": "moto g - 2025",
570
+ "motorola:motorola razr 2024": "motorola razr 2024",
571
+ "samsung:sm-s926u": "Galaxy S24+",
572
+ "sony:xq-at52": "Xperia 1 II",
573
+ "poco:24122rkc7g": "POCO F7 Ultra",
574
+ "fossibot:f102": "F102",
575
+ "samsung:sm-x826b": "Galaxy Tab S10+ 5G",
576
+ "realme:rmx3771": "realme 10 Pro 5G",
577
+ "redmi:23021raaeg": "Redmi Note 12",
578
+ "redmi:m2101k7bl": "Redmi Note 10S",
579
+ "motorola:moto g85 5g": "moto g85 5G",
580
+ "samsung:sm-e156b": "Galaxy M15 5G",
581
+ "asus:asus_ai2302": "Zenfone 10 (AI2302)",
582
+ "itel:itel s667ln": "itel S24",
583
+ "samsung:sm-g991n": "Galaxy S21 5G",
584
+ "samsung:sm-m127g": "Galaxy M12",
585
+ "samsung:sm-s9080": "Galaxy S22 Ultra",
586
+ "tecno:tecno ck7n": "CAMON 20 Pro",
587
+ "samsung:sm-x800": "Galaxy Tab S8+",
588
+ "oppo:pcam00": "Reno \u6807\u51c6\u7248",
589
+ "google:pixel 4 xl": "Pixel 4 XL",
590
+ "oppo:cph2577": "A58",
591
+ "oneplus:dn2101": "OnePlus Nord2 5G",
592
+ "xiaomi:2112123ac": "Xiaomi 12X",
593
+ "motorola:motorola edge 40 pro": "motorola edge 40 pro",
594
+ "tecno:tecno cl8": "TECNO CAMON 30 Pro 5G",
595
+ "vivo:v2247": "Y27s",
596
+ "oppo:phz110": "Find X7",
597
+ "samsung:sm-x806b": "Galaxy Tab S8+ 5G",
598
+ "vivo:v2403a": "iQOO Neo9S Pro+",
599
+ "realme:rmx3151": "realme 8i",
600
+ "realme:rmx2193": "realme 7i",
601
+ "redmi:m2101k7ai": "Redmi Note 10",
602
+ "motorola:motorola edge 30 neo": "motorola edge 30 neo",
603
+ "vivo:v2425a": "iQOO Neo10",
604
+ "xiaomi:24129pn74g": "Xiaomi 15",
605
+ "motorola:moto g14": "moto g14",
606
+ "oppo:cph2697": "Reno13 Pro 5G",
607
+ "samsung:sm-a166p": "Galaxy A16 5G",
608
+ "oneplus:cph2399": "OnePlus Nord 2T 5G",
609
+ "samsung:sm-g975f": "Galaxy S10+",
610
+ "samsung:sm-s938n": "Galaxy S25 Ultra",
611
+ "redmi:redmi note 9 pro": "Redmi Note 9 Pro",
612
+ "vivo:v2427": "V50",
613
+ "redmi:23117rk66c": "Redmi K70 Pro",
614
+ "oppo:cph2325": "CPH2325",
615
+ "realme:rmx3370": "realme GT Neo 2",
616
+ "samsung:sm-a920f": "Galaxy A9 (2018)",
617
+ "samsung:sm-s9310": "Galaxy S25",
618
+ "samsung:sm-a5360": "Galaxy A53 5G",
619
+ "vivo:v2419a": "V2419A",
620
+ "realme:rmx3363": "realme GT Master Edition",
621
+ "samsung:sm-a5560": "Galaxy A55 5G",
622
+ "realme:rmx3461": "realme 9 5G Speed Edition",
623
+ "samsung:sm-s938q": "Galaxy S25 Ultra",
624
+ "oneplus:cph2411": "OnePlus 10R 5G",
625
+ "oppo:cph2495": "A78 5G",
626
+ "realme:rmx3624": "realme C33",
627
+ "tecno:tecno ci8n": "CAMON 19 Pro",
628
+ "redmi:22071219ai": "Redmi 11 Prime",
629
+ "vivo:vivo 1921": "vivo 1921",
630
+ "blackview:bv7100": "BV7100",
631
+ "realme:rmx3563": "realme GT NEO 3 150W"
632
  }