Download src/utils/model_utils.py from YifengJiao/ChromFound: direct link, hf CLI and curl.
- Browser
- Download file 319 Bytes
-
https://huggingface.co/YifengJiao/ChromFound/resolve/main/src/utils/model_utils.py
- Command line
-
hf download hf://YifengJiao/ChromFound/src/utils/model_utils.py
-
curl -L -o model_utils.py https://huggingface.co/YifengJiao/ChromFound/resolve/main/src/utils/model_utils.py
319 Bytes
| import yaml | |
| class ModelUtils: | |
| def get_chromosome_vocab(cls, file_path): | |
| with open(file_path) as file: | |
| chromosome_vocab = yaml.safe_load(file) | |
| chromosome_vocab = {chr_: idx for idx, chr_ in enumerate(chromosome_vocab["chromosome"])} | |
| return chromosome_vocab | |