sasha HF staff commited on
Commit
7ddc374
β€’
1 Parent(s): 2e546fd

adding energy

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -28,11 +28,14 @@ def make_link(mname):
28
  def get_model_names(task_data):
29
  #TODO: add link to results in model card of each model
30
  task_df= pd.read_csv('data/params/'+task_data)
 
31
  task_df= task_df.rename(columns={"Link": "model"})
32
- task_df=task_df.drop_duplicates(subset=['model'])
33
- task_df['parameters'] = task_df['parameters'].apply(format_params)
34
- task_df['model'] = task_df['model'].apply(make_link)
35
- model_names = task_df[['model','parameters']]
 
 
36
  print(model_names)
37
  return model_names
38
 
 
28
  def get_model_names(task_data):
29
  #TODO: add link to results in model card of each model
30
  task_df= pd.read_csv('data/params/'+task_data)
31
+ energy_df= pd.read_csv('data/energy/'+task_data)
32
  task_df= task_df.rename(columns={"Link": "model"})
33
+ all_df = pd.merge(task_df, energy_df, on='model')
34
+ all_df=all_df.drop_duplicates(subset=['model'])
35
+ all_df['parameters'] = all_df['parameters'].apply(format_params)
36
+ all_df['model'] = all_df['model'].apply(make_link)
37
+ all_df['Total GPU Energy (Wh)'] = all_df['Total GPU Energy (Wh)'].round(2)
38
+ model_names = all_df[['model','parameters','Total GPU Energy (Wh)']]
39
  print(model_names)
40
  return model_names
41