Spaces:
Running
Running
Download solar_eval/pipelines/base.py from dev-strender/proofread-demo: direct link, hf CLI and curl.
- Browser
- Download file 1.24 kB
-
https://huggingface.co/spaces/dev-strender/proofread-demo/resolve/main/solar_eval/pipelines/base.py
- Command line
-
hf download hf://spaces/dev-strender/proofread-demo/solar_eval/pipelines/base.py
-
curl -L -o base.py https://huggingface.co/spaces/dev-strender/proofread-demo/resolve/main/solar_eval/pipelines/base.py
1.24 kB
| from abc import ABC, abstractmethod | |
| from solar_eval.models.sample import EvalSample | |
| from solar_eval.providers.base import BaseProvider | |
| class BasePipeline(ABC): | |
| async def run( | |
| self, | |
| sample: EvalSample, | |
| *, | |
| prompts: str, | |
| provider: BaseProvider, | |
| model: str, | |
| temperature: float = 0.0, | |
| max_tokens: int = 8000, | |
| reasoning_effort: str | None = None, | |
| messages: list[dict[str, str]] | None = None, | |
| ) -> EvalSample: | |
| """`sample.input` ์ ์ฝ์ด `sample.output` ์ ์ฑ์ฐ๊ณ ๋๋๋ ค์ค๋ค. | |
| ๋ฉํฐ์คํ ํ์ดํ๋ผ์ธ์ ์คํ ๋ง๋ค `sample.output` ์ ๋ฎ์ด์ฐ๋ฉด์ | |
| `sample.artifacts["step_outputs"]` ์ {์คํ ์ด๋ฆ: ๊ทธ ์คํ ์งํ output} ์ | |
| ๋์ ํ๋ค. usage/timing ๋ฉํ๋ฐ์ดํฐ๋ `sample.artifacts["usage"]` / | |
| `sample.artifacts["inference_time_ms"]` ์ ๋ด๋๋ค. | |
| Args: | |
| sample: ์ฑ์ธ ์ํ. `sample.input` ์ด ํ์ดํ๋ผ์ธ ์ ๋ ฅ์ด๋ค. | |
| prompts: single-step ์ ์์คํ ํ๋กฌํํธ. multi-step ์ ์คํ ๋ณ | |
| ํ๋กฌํํธ๊ฐ ์์ฑ์์์ ์ด๋ฏธ ์ฃผ์ ๋ผ ์์ด ์ด ์ธ์๋ฅผ ์ฐ์ง ์๋๋ค. | |
| """ | |
| ... | |