Spaces:
Build error
Build error
Download utils.py from Ngene787/Faice_text2face: direct link, hf CLI and curl.
- Browser
- Download file 528 Bytes
-
https://huggingface.co/spaces/Ngene787/Faice_text2face/resolve/main/utils.py
- Command line
-
hf download hf://spaces/Ngene787/Faice_text2face/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/Ngene787/Faice_text2face/resolve/main/utils.py
528 Bytes
| # -*- coding: UTF-8 -*- | |
| """ | |
| @Time : 28/05/2025 16:17 | |
| @Author : xiaoguangliang | |
| @File : utils.py | |
| @Project : Faice_text2face | |
| """ | |
| import time | |
| from contextlib import contextmanager | |
| def timer(msg="all tasks"): | |
| """ | |
| Calculate the time of running | |
| @return: | |
| """ | |
| startTime = time.time() | |
| yield | |
| endTime = time.time() | |
| # print(f'The time cost for {msg}:{round(1000.0 * (endTime - startTime), 2)}, ms') | |
| print(f"The time cost for {msg}:", round((endTime - startTime) / 60, 2), "minutes") | |