Download src/data/spec.py from monaverse/UniRig: direct link, hf CLI and curl.
- Browser
- Download file 437 Bytes
-
https://huggingface.co/spaces/monaverse/UniRig/resolve/main/src/data/spec.py
- Command line
-
hf download hf://spaces/monaverse/UniRig/src/data/spec.py
-
curl -L -o spec.py https://huggingface.co/spaces/monaverse/UniRig/resolve/main/src/data/spec.py
437 Bytes
| from abc import ABC, abstractmethod | |
| from dataclasses import fields | |
| class ConfigSpec(ABC): | |
| def check_keys(cls, config): | |
| expect = [field.name for field in fields(cls)] | |
| for key in config.keys(): | |
| if key not in expect: | |
| raise ValueError(f"expect names {expect} in {cls.__name__}, found {key}") | |
| def parse(cls, config): | |
| pass | |