Spaces:
Runtime error
Runtime error
Download util.py from Topcoder-Platform/HealthAI-Chef: direct link, hf CLI and curl.
- Browser
- Download file 374 Bytes
-
https://huggingface.co/spaces/Topcoder-Platform/HealthAI-Chef/resolve/main/util.py
- Command line
-
hf download hf://spaces/Topcoder-Platform/HealthAI-Chef/util.py
-
curl -L -o util.py https://huggingface.co/spaces/Topcoder-Platform/HealthAI-Chef/resolve/main/util.py
374 Bytes
| UTF8_ENCODING = 'utf-8' | |
| def load_prompt(file_name: str) -> str: | |
| with open(f'prompts/{file_name}', 'r', encoding=UTF8_ENCODING) as f: | |
| return f.read() | |
| def yield_lines_from_file(file_path: str): | |
| with open(f'data/{file_path}', 'r', encoding=UTF8_ENCODING) as f: | |
| for line in f: | |
| if line: # includes newline | |
| yield line.strip() | |