rodrigomasini commited on
Commit
8b953e2
1 Parent(s): 16b1923

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -776,14 +776,6 @@ def get_mteb_average():
776
 
777
  DATA_OVERALL=get_mteb_average()
778
  print(DATA_OVERALL)
779
-
780
- data_overall = gr.components.Dataframe(
781
- headers=DATA_OVERALL.columns.tolist(),
782
- datatype=DATA_OVERALL.values.tolist(),
783
- visible=False,
784
- line_breaks=False,
785
- interactive=False
786
- )
787
 
788
  import unicodedata
789
 
@@ -800,6 +792,18 @@ def remove_invalid_unicode(input_string):
800
  return ''.join(valid_chars)
801
  else:
802
  return input_string # Return non-string values as is
 
 
 
 
 
 
 
 
 
 
 
 
803
 
804
  def display(x, y):
805
  global data_overall # Ensure we're accessing the global variable
 
776
 
777
  DATA_OVERALL=get_mteb_average()
778
  print(DATA_OVERALL)
 
 
 
 
 
 
 
 
779
 
780
  import unicodedata
781
 
 
792
  return ''.join(valid_chars)
793
  else:
794
  return input_string # Return non-string values as is
795
+
796
+ for column in DATA_OVERALL.columns:
797
+ if DATA_OVERALL[column].dtype == 'object':
798
+ DATA_OVERALL[column] = DATA_OVERALL[column].apply(remove_invalid_unicode)
799
+
800
+ data_overall = gr.components.Dataframe(
801
+ headers=DATA_OVERALL.columns.tolist(),
802
+ datatype=DATA_OVERALL.values.tolist(),
803
+ visible=False,
804
+ line_breaks=False,
805
+ interactive=False
806
+ )
807
 
808
  def display(x, y):
809
  global data_overall # Ensure we're accessing the global variable