Spaces:
Runtime error
Runtime error
| """⭐ Text Classification with Optimum and ONNXRuntime | |
| Utils functions. | |
| Author: | |
| - @ChainYo - https://github.com/ChainYo | |
| """ | |
| from time import time | |
| def timeit(func): | |
| """Timeit decorator.""" | |
| def wrapper(*args, **kwargs): | |
| """Wrapper.""" | |
| start = time() | |
| result = func(*args, **kwargs) | |
| end = time() | |
| print(f"{func.__name__} took {end - start:.2f} seconds.") | |
| return result | |
| return wrapper | |