Instructions to use theunnecessarythings/JADE with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use theunnecessarythings/JADE with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
Download jade/index.py from theunnecessarythings/JADE: direct link, hf CLI and curl.
- Browser
- Download file 1.21 kB
-
https://huggingface.co/theunnecessarythings/JADE/resolve/main/jade/index.py
- Command line
-
hf download hf://theunnecessarythings/JADE/jade/index.py
-
curl -L -o index.py https://huggingface.co/theunnecessarythings/JADE/resolve/main/jade/index.py
1.21 kB
| """Decision Index interface for JADE.""" | |
| from .engine import JadeEngine, UnsupportedInput | |
| class DecisionIndexEngine(JadeEngine): | |
| name = "jade" | |
| latency = "In-process vLLM wall time including rendering; model initialization excluded." | |
| def __call__(self, state, questions): | |
| from decision_index.engines.base import Unsupported | |
| try: | |
| return super().__call__(state, questions) | |
| except UnsupportedInput as exc: | |
| raise Unsupported(str(exc)) from exc | |
| def close(self): | |
| del self.model | |
| def warmup(self): | |
| questions = { | |
| "warmup": { | |
| "type": "choice", | |
| "instructions": "Which color is named?", | |
| "criteria": {"red": "red", "blue": "blue"}, | |
| } | |
| } | |
| for _ in range(2): | |
| self("The color is red.", questions) | |
| def runtime(self): | |
| import torch | |
| import vllm | |
| return { | |
| "torch": torch.__version__, | |
| "vllm": vllm.__version__, | |
| "cuda": torch.version.cuda, | |
| "gpu": torch.cuda.get_device_name(), | |
| } | |
| def synchronize(self): | |
| import torch | |
| torch.cuda.synchronize() | |