Instructions to use BayesTensor/out with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use BayesTensor/out with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-7B-Instruct") model = PeftModel.from_pretrained(base_model, "BayesTensor/out") - Notebooks
- Google Colab
- Kaggle
Download lm-evaluation-harness/lm_eval/api/instance.py from BayesTensor/out: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/BayesTensor/out/resolve/main/lm-evaluation-harness/lm_eval/api/instance.py
- Command line
-
hf download hf://BayesTensor/out/lm-evaluation-harness/lm_eval/api/instance.py
-
curl -L -o instance.py https://huggingface.co/BayesTensor/out/resolve/main/lm-evaluation-harness/lm_eval/api/instance.py
1.06 kB
| from dataclasses import dataclass, field | |
| from typing import Literal, Optional, Tuple | |
| OutputType = Literal[ | |
| "loglikelihood", "loglikelihood_rolling", "generate_until", "multiple_choice" | |
| ] | |
| class Instance: | |
| request_type: OutputType | |
| doc: dict | |
| arguments: tuple | |
| idx: int | |
| metadata: Tuple[Optional[str], Optional[int], Optional[int]] = field( | |
| default_factory=lambda: (None, None, None) | |
| ) | |
| resps: list = field(default_factory=list) | |
| filtered_resps: dict = field(default_factory=dict) | |
| # initialized after init | |
| task_name: Optional[str] = None | |
| doc_id: Optional[int] = None | |
| repeats: Optional[int] = None | |
| def __post_init__(self) -> None: | |
| # unpack metadata field | |
| self.task_name, self.doc_id, self.repeats = self.metadata | |
| def args(self): | |
| """ | |
| Returns (string,) where `string` is the string to calculate loglikelihood over | |
| """ | |
| return ( | |
| self.arguments if isinstance(self.arguments, tuple) else (self.arguments,) | |
| ) | |