Zekun Wu commited on
Commit
5f01d2e
·
1 Parent(s): f4c36a8
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -43,15 +43,14 @@ def calculate_flops_hf(model_name, input_shape, access_token, bp_factor, output_
43
  bp_factor=bp_factor, output_unit=output_unit)
44
  print(f"Data: {data}")
45
 
46
- df = data['value']
47
- total_flops = df['Forward+Backward FLOPs'][0] * 10 ** 9 # Convert GFLOPs to FLOPs
48
  threshold_flops = 10 ** 25
49
  meets_criteria = total_flops > threshold_flops
50
 
51
  return {
52
  "total_flops": total_flops,
53
  "meets_criteria": meets_criteria,
54
- "dataframe": df,
55
  "return_print": return_print
56
  }
57
 
 
43
  bp_factor=bp_factor, output_unit=output_unit)
44
  print(f"Data: {data}")
45
 
46
+ total_flops = data[0]['Forward+Backward FLOPs'] * 10 ** 9 # Convert GFLOPs to FLOPs
 
47
  threshold_flops = 10 ** 25
48
  meets_criteria = total_flops > threshold_flops
49
 
50
  return {
51
  "total_flops": total_flops,
52
  "meets_criteria": meets_criteria,
53
+ "dataframe": data,
54
  "return_print": return_print
55
  }
56