Corey Morris commited on
Commit
93fe92a
·
1 Parent(s): 627b779

fixed the warning by excaping the special character. Renamed a function

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -9,7 +9,7 @@ class MultiURLData:
9
  def __init__(self):
10
  pass
11
 
12
- def fetch_data(self):
13
 
14
  dataframes = []
15
 
@@ -33,7 +33,7 @@ class MultiURLData:
33
  df.index = df.index.str.replace('hendrycksTest-', '')
34
 
35
  # Remove'harness|' from the index
36
- df.index = df.index.str.replace('harness|', '')
37
 
38
 
39
  dataframes.append(df[[model_name]]) # keep only the column of interest
@@ -62,8 +62,8 @@ with block:
62
  data = gr.outputs.Dataframe(type="pandas")
63
  with gr.Row():
64
  data_run = gr.Button("Refresh")
65
- data_run.click(data_provider.fetch_data, inputs=None, outputs=data)
66
  # running the function on page load in addition to when the button is clicked
67
- block.load(data_provider.fetch_data, inputs=None, outputs=data)
68
 
69
  block.launch()
 
9
  def __init__(self):
10
  pass
11
 
12
+ def process_data(self):
13
 
14
  dataframes = []
15
 
 
33
  df.index = df.index.str.replace('hendrycksTest-', '')
34
 
35
  # Remove'harness|' from the index
36
+ df.index = df.index.str.replace('harness\\|', '')
37
 
38
 
39
  dataframes.append(df[[model_name]]) # keep only the column of interest
 
62
  data = gr.outputs.Dataframe(type="pandas")
63
  with gr.Row():
64
  data_run = gr.Button("Refresh")
65
+ data_run.click(data_provider.process_data, inputs=None, outputs=data)
66
  # running the function on page load in addition to when the button is clicked
67
+ block.load(data_provider.process_data, inputs=None, outputs=data)
68
 
69
  block.launch()