Download src/nexforgetokenizer/data/__init__.py from Johnnyman1100/EZ-Tokenizer: direct link, hf CLI and curl.
- Browser
- Download file 682 Bytes
-
https://huggingface.co/Johnnyman1100/EZ-Tokenizer/resolve/main/src/nexforgetokenizer/data/__init__.py
- Command line
-
hf download hf://Johnnyman1100/EZ-Tokenizer/src/nexforgetokenizer/data/__init__.py
-
curl -L -o __init__.py https://huggingface.co/Johnnyman1100/EZ-Tokenizer/resolve/main/src/nexforgetokenizer/data/__init__.py
682 Bytes
| """Data handling for NexForge Tokenizer.""" | |
| import os | |
| from pathlib import Path | |
| from typing import Optional | |
| def get_data_path() -> Path: | |
| """Get the path to the package data directory.""" | |
| return Path(__file__).parent | |
| def get_sample_data_path() -> Optional[Path]: | |
| """Get the path to the sample Python code file.""" | |
| data_path = get_data_path() / "python_code_sample.txt" | |
| return data_path if data_path.exists() else None | |
| def load_sample_data() -> Optional[str]: | |
| """Load and return the sample Python code as a string.""" | |
| sample_path = get_sample_data_path() | |
| if sample_path is None: | |
| return None | |
| return sample_path.read_text(encoding='utf-8') | |