Spaces:
Paused
Paused
Download modules/util.py from QualityMinds/Osterkarten: direct link, hf CLI and curl.
- Browser
- Download file 504 Bytes
-
https://huggingface.co/spaces/QualityMinds/Osterkarten/resolve/main/modules/util.py
- Command line
-
hf download hf://spaces/QualityMinds/Osterkarten/modules/util.py
-
curl -L -o util.py https://huggingface.co/spaces/QualityMinds/Osterkarten/resolve/main/modules/util.py
504 Bytes
| import datetime | |
| import random | |
| import os | |
| def generate_temp_filename(folder='./outputs/', extension='png'): | |
| current_time = datetime.datetime.now() | |
| date_string = current_time.strftime("%Y-%m-%d") | |
| time_string = current_time.strftime("%Y-%m-%d_%H-%M-%S") | |
| random_number = random.randint(1000, 9999) | |
| filename = f"{time_string}_{random_number}.{extension}" | |
| result = os.path.join(folder, date_string, filename) | |
| return date_string, os.path.abspath(os.path.realpath(result)), filename | |