Spaces:
Running
Running
Update model_utils.py
Browse files- model_utils.py +10 -10
model_utils.py
CHANGED
@@ -37,16 +37,16 @@ def calculate_flops_in_hugging_space(model_name: str,
|
|
37 |
"Calculates the FLOPs and Params usage for a model init on `meta` device"
|
38 |
|
39 |
try:
|
40 |
-
print("model_name:", model_name)
|
41 |
-
print("empty_model:", empty_model)
|
42 |
-
print("access_token:", access_token)
|
43 |
-
print("input_shape:", input_shape)
|
44 |
-
flops, macs, params, return_print
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
except Exception as e:
|
51 |
print("Error info:", e)
|
52 |
raise gr.Error(
|
|
|
37 |
"Calculates the FLOPs and Params usage for a model init on `meta` device"
|
38 |
|
39 |
try:
|
40 |
+
# print("model_name:", model_name)
|
41 |
+
# print("empty_model:", empty_model)
|
42 |
+
# print("access_token:", access_token)
|
43 |
+
# print("input_shape:", input_shape)
|
44 |
+
flops, macs, params, return_print = calculate_flops_hf(model_name=model_name,
|
45 |
+
empty_model=empty_model,
|
46 |
+
input_shape=input_shape,
|
47 |
+
access_token=access_token,
|
48 |
+
output_as_string=False,
|
49 |
+
return_results=True)
|
50 |
except Exception as e:
|
51 |
print("Error info:", e)
|
52 |
raise gr.Error(
|