Spaces:
Sleeping
Sleeping
fix: post_optimization() call.
Browse files
main.py
CHANGED
@@ -13,7 +13,9 @@ This Space does the following things:
|
|
13 |
* Loads a ResNet50 model from `tf.keras.applications` and serializes it as a SavedModel.
|
14 |
* Performs optimizations with TensorRT.
|
15 |
* Runs and displays the benchmarks to compare the throughputs of the native TensorFlow SavedModel and its TensorRT-optimized variant.
|
16 |
-
* Optionally, pushes the optimized model to a repository on the Hugging Face Hub. For this to work, one must provide a write-access token (from
|
|
|
|
|
17 |
|
18 |
## Notes (important)
|
19 |
|
@@ -68,7 +70,7 @@ def run(hf_token: str) -> str:
|
|
68 |
tf_throughput = benchmark(model)
|
69 |
tf_trt_throughput = benchmark(tensorrt_path)
|
70 |
|
71 |
-
benchmark_str = post_optimization(tf_throughput, tf_trt_throughput)
|
72 |
benchmark_str += "\n"
|
73 |
benchmark_str += push_to_hub(hf_token, tensorrt_path)
|
74 |
|
|
|
13 |
* Loads a ResNet50 model from `tf.keras.applications` and serializes it as a SavedModel.
|
14 |
* Performs optimizations with TensorRT.
|
15 |
* Runs and displays the benchmarks to compare the throughputs of the native TensorFlow SavedModel and its TensorRT-optimized variant.
|
16 |
+
* Optionally, pushes the optimized model to a repository on the Hugging Face Hub. For this to work, one must provide a write-access token (from hf.co/settings/tokens) to `your_hf_token`.
|
17 |
+
|
18 |
+
As a consequence, you might have to wait for a few minutes to note the results.
|
19 |
|
20 |
## Notes (important)
|
21 |
|
|
|
70 |
tf_throughput = benchmark(model)
|
71 |
tf_trt_throughput = benchmark(tensorrt_path)
|
72 |
|
73 |
+
benchmark_str = post_optimization([tf_throughput, tf_trt_throughput])
|
74 |
benchmark_str += "\n"
|
75 |
benchmark_str += push_to_hub(hf_token, tensorrt_path)
|
76 |
|