Download model/models/results.py from OneScience-Group/Chainsaw: direct link, hf CLI and curl.
- Browser
- Download file 608 Bytes
-
https://huggingface.co/OneScience-Group/Chainsaw/resolve/main/model/models/results.py
- Command line
-
hf download hf://OneScience-Group/Chainsaw/model/models/results.py
-
curl -L -o results.py https://huggingface.co/OneScience-Group/Chainsaw/resolve/main/model/models/results.py
608 Bytes
| from pathlib import Path | |
| from typing import Optional | |
| from pydantic import BaseModel, validator | |
| def chain_id_from_pdb_path(pdb_path: Path): | |
| return pdb_path.stem | |
| class PredictionResult(BaseModel): | |
| pdb_path: Path | |
| confidence: float | |
| chain_id: Optional[str] = None | |
| sequence_md5: str | |
| ndom: int | |
| nres: int | |
| chopping: Optional[str] = None | |
| time_sec: Optional[float] = None | |
| def set_chain_id(cls, v, values): | |
| if v is None: | |
| return chain_id_from_pdb_path(values['pdb_path']) | |
| return v | |