Download src/utils.py from e2dew32/free_api: direct link, hf CLI and curl.
- Browser
- Download file 417 Bytes
-
https://huggingface.co/spaces/e2dew32/free_api/resolve/main/src/utils.py
- Command line
-
hf download hf://spaces/e2dew32/free_api/src/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/e2dew32/free_api/resolve/main/src/utils.py
417 Bytes
| import re | |
| from datetime import datetime | |
| def clean_model_name(model_id: str) -> str: | |
| if "/" in model_id: | |
| model_id = model_id.split("/")[-1] | |
| if ":free" in model_id: | |
| model_id = model_id.replace(":free", "") | |
| return model_id.strip() | |
| def format_timestamp(dt: datetime = None) -> str: | |
| if dt is None: | |
| dt = datetime.now() | |
| return dt.strftime("%Y-%m-%d %H:%M:%S") | |