Download components/parser/paths.py from muryshev/generic-chatbot-backend: direct link, hf CLI and curl.
- Browser
- Download file 1.3 kB
-
https://huggingface.co/spaces/muryshev/generic-chatbot-backend/resolve/main/components/parser/paths.py
- Command line
-
hf download hf://spaces/muryshev/generic-chatbot-backend/components/parser/paths.py
-
curl -L -o paths.py https://huggingface.co/spaces/muryshev/generic-chatbot-backend/resolve/main/components/parser/paths.py
1.3 kB
| import os | |
| from pathlib import Path | |
| class DatasetPaths: | |
| """ | |
| Класс для хранения путей к файлам и директориям, задействованным при формировании датасета. | |
| root_path: os.PathLike - корневая директория, в которой будет храниться датасет | |
| save_intermediate_files: bool - флаг, указывающий, нужно ли сохранять промежуточные файлы, \ | |
| которые используются только при формировании датасета | |
| """ | |
| def __init__( | |
| self, | |
| root_path: os.PathLike, | |
| save_intermediate_files: bool = False, | |
| ): | |
| self.root_path = Path(root_path) | |
| self.abbreviations = self.root_path / 'abbreviations.csv' | |
| self.xml_info = self.root_path / 'xml_info.csv' | |
| self.dataset = self.root_path / 'dataset.pkl' | |
| self.save_intermediate_files = save_intermediate_files | |
| self.txt_path = self.root_path / 'txt' if save_intermediate_files else None | |
| self.txt_abbr = self.root_path / 'txt_abbr' if save_intermediate_files else None | |
| self.jsons_path = self.root_path / 'jsons' if save_intermediate_files else None | |