Download src/ae_misc.py from 2Dmatters/Elf_encoder: direct link, hf CLI and curl.
- Browser
- Download file 314 Bytes
-
https://huggingface.co/2Dmatters/Elf_encoder/resolve/main/src/ae_misc.py
- Command line
-
hf download hf://2Dmatters/Elf_encoder/src/ae_misc.py
-
curl -L -o ae_misc.py https://huggingface.co/2Dmatters/Elf_encoder/resolve/main/src/ae_misc.py
314 Bytes
| #!/usr/bin/env python | |
| """ | |
| Miscallenous functions for autoencoders | |
| """ | |
| def predict(learn, item, rm_type_tfms=None, with_input=False): | |
| dl = learn.dls.test_dl([item], rm_type_tfms=rm_type_tfms, num_workers=0) | |
| inp,preds,_,dec_preds = learn.get_preds(dl=dl, with_input=True, with_decoded=True) | |
| return preds |