You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
petals/src/petals/client/spending_policy.py

15 lines
409 B
Python

from abc import ABC, abstractmethod
from hivemind.proto.runtime_pb2 import ExpertRequest
class SpendingPolicyBase(ABC):
@abstractmethod
def get_points(self, request: ExpertRequest, method_name: str, *args, **kwargs) -> float:
pass
class NoSpendingPolicy(SpendingPolicyBase):
def get_points(self, request: ExpertRequest, method_name: str, *args, **kwargs) -> float:
return 0.0