Download src_code_for_reproducibility/models/inference_backend.py from LLMnegotiation/tas_rps_naive: direct link, hf CLI and curl.
- Browser
- Download file 915 Bytes
-
https://huggingface.co/LLMnegotiation/tas_rps_naive/resolve/main/src_code_for_reproducibility/models/inference_backend.py
- Command line
-
hf download hf://LLMnegotiation/tas_rps_naive/src_code_for_reproducibility/models/inference_backend.py
-
curl -L -o inference_backend.py https://huggingface.co/LLMnegotiation/tas_rps_naive/resolve/main/src_code_for_reproducibility/models/inference_backend.py
915 Bytes
| from abc import ABC, abstractmethod | |
| from dataclasses import dataclass | |
| from typing import Any, Optional | |
| class LLMInferenceOutput: | |
| content: str | |
| reasoning_content: str | None = None | |
| log_probs: list[float] | None = None | |
| out_token_ids: list[int] | None = None | |
| class LLMInferenceBackend(ABC): | |
| def __init__(self, **kwargs): | |
| ... | |
| def prepare_adapter( | |
| self, adapter_id: str, weights_got_updated: bool = False | |
| ) -> None: | |
| """Ensure adapter is ready/loaded for next generation call.""" | |
| async def generate(self, prompt: list[dict], regex: Optional[str] = None) -> str: | |
| ... | |
| def toggle_training_mode(self) -> None: | |
| ... | |
| def toggle_eval_mode(self) -> None: | |
| ... | |
| def shutdown(self) -> None: | |
| ... | |