Spaces:
Runtime error
Runtime error
Zekun Wu
commited on
Commit
·
a368681
1
Parent(s):
007e487
add
Browse files
app.py
CHANGED
@@ -33,14 +33,14 @@ def calculate_flops_gpu(gpu_hours, power_consumption_w, flops_per_gpu_s):
|
|
33 |
}
|
34 |
|
35 |
|
36 |
-
def calculate_flops_hf(model_name, input_shape, access_token, bp_factor
|
37 |
"""
|
38 |
Calculate FLOPs using Hugging Face model information.
|
39 |
"""
|
40 |
model = get_mode_from_hf(model_name=model_name, library="auto", access_token=access_token)
|
41 |
data, return_print = calculate_flops_in_hugging_space(model_name=model_name, empty_model=model,
|
42 |
access_token=access_token, input_shape=input_shape,
|
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
|
|
|
33 |
}
|
34 |
|
35 |
|
36 |
+
def calculate_flops_hf(model_name, input_shape, access_token, bp_factor):
|
37 |
"""
|
38 |
Calculate FLOPs using Hugging Face model information.
|
39 |
"""
|
40 |
model = get_mode_from_hf(model_name=model_name, library="auto", access_token=access_token)
|
41 |
data, return_print = calculate_flops_in_hugging_space(model_name=model_name, empty_model=model,
|
42 |
access_token=access_token, input_shape=input_shape,
|
43 |
+
bp_factor=bp_factor,output_unit="")#, output_unit=output_unit)
|
44 |
print(f"Data: {data}")
|
45 |
|
46 |
total_flops = data[0]['Forward+Backward FLOPs'] * 10 ** 9 # Convert GFLOPs to FLOPs
|