Spaces:
Running
Running
Download utils.py from michaelj/FastAPI_lcm_docker: direct link, hf CLI and curl.
- Browser
- Download file 593 Bytes
-
https://huggingface.co/spaces/michaelj/FastAPI_lcm_docker/resolve/80f3ced06fb77a542f78b11f06d640046bbd5c4f/utils.py
- Command line
-
hf download hf://spaces/michaelj/FastAPI_lcm_docker@80f3ced06fb77a542f78b11f06d640046bbd5c4f/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/michaelj/FastAPI_lcm_docker/resolve/80f3ced06fb77a542f78b11f06d640046bbd5c4f/utils.py
593 Bytes
| import platform | |
| from typing import List | |
| def show_system_info(): | |
| try: | |
| print(f"Running on {platform.system()} platform") | |
| print(f"OS: {platform.platform()}") | |
| print(f"Processor: {platform.processor()}") | |
| except Exception as ex: | |
| print(f"Error ocurred while getting system information {ex}") | |
| def get_models_from_text_file(file_path: str) -> List: | |
| models = [] | |
| with open(file_path, "r") as file: | |
| lines = file.readlines() | |
| for repo_id in lines: | |
| if repo_id.strip() != "": | |
| models.append(repo_id.strip()) | |
| return models | |