EssayScoring / model /common.py
JacobLinCool's picture
feat: grader info
2e6bf26
raw
history blame contribute delete
494 Bytes
from typing import Tuple
import spaces
from accelerate import Accelerator
accelerator = Accelerator()
device = accelerator.device
class Grader:
def info(self) -> str:
raise NotImplementedError("Method info not implemented")
def grade(self, question: str, answer: str) -> Tuple[float, str]:
raise NotImplementedError("Method grade not implemented")
def __call__(self, question: str, answer: str) -> Tuple[float, str]:
return self.grade(question, answer)