Spaces:
Configuration error
Configuration error
Download openhands/critic/base.py from flyingdarkdev/README: direct link, hf CLI and curl.
- Browser
- Download file 610 Bytes
-
https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/openhands/critic/base.py
- Command line
-
hf download hf://spaces/flyingdarkdev/README/openhands/critic/base.py
-
curl -L -o base.py https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/openhands/critic/base.py
610 Bytes
| import abc | |
| from pydantic import BaseModel | |
| from openhands.events import Event | |
| class CriticResult(BaseModel): | |
| """ | |
| A critic result is a score and a message. | |
| """ | |
| score: float | |
| message: str | |
| def success(self) -> bool: | |
| """ | |
| Whether the agent is successful. | |
| """ | |
| return self.score >= 0.5 | |
| class BaseCritic(abc.ABC): | |
| """ | |
| A critic is a function that takes in a list of events and returns a score about the quality of those events. | |
| """ | |
| def evaluate(self, events: list[Event]) -> CriticResult: | |
| pass | |