Spaces:
Sleeping
Sleeping
Download curriculum.py from tbels89/Prometheus: direct link, hf CLI and curl.
- Browser
- Download file 1.21 kB
-
https://huggingface.co/spaces/tbels89/Prometheus/resolve/main/curriculum.py
- Command line
-
hf download hf://spaces/tbels89/Prometheus/curriculum.py
-
curl -L -o curriculum.py https://huggingface.co/spaces/tbels89/Prometheus/resolve/main/curriculum.py
1.21 kB
| # curriculum.py | |
| from logging_config import logger | |
| # Function to load the curriculum | |
| def load_curriculum(file_path): | |
| """ | |
| Reads the curriculum text file and returns its content as a string. | |
| Args: | |
| file_path (str): Path to the text file. | |
| Returns: | |
| str: Contents of the text file. | |
| """ | |
| logger.info(f"Attempting to load curriculum from: {file_path}") | |
| try: | |
| with open(file_path, 'r', encoding='utf-8') as file: | |
| content = file.read().strip() | |
| logger.info(f"Successfully loaded curriculum. Content length: {len(content)} characters.") | |
| return content | |
| except FileNotFoundError: | |
| logger.error(f"The curriculum file '{file_path}' does not exist.") | |
| return "Curriculum file not found." | |
| except Exception as e: | |
| logger.error(f"Error reading the curriculum file: {e}") | |
| return "An error occurred while loading the curriculum." | |
| # Define loaded curriculum as variable | |
| CURRICULUM_FILE_PATH = './data/curriculum.txt' | |
| logger.info(f"Initializing curriculum loading from path: {CURRICULUM_FILE_PATH}") | |
| CURRICULUM_SUMMARY = load_curriculum(CURRICULUM_FILE_PATH) | |
| logger.info("Curriculum loading complete.") |