request.py 638 B

123456789101112131415161718192021222324252627282930
  1. from dataclasses import dataclass
  2. from aphrodite.adapter_commons.request import AdapterRequest
  3. @dataclass
  4. class PromptAdapterRequest(AdapterRequest):
  5. """
  6. Request for a Prompt adapter.
  7. """
  8. prompt_adapter_name: str
  9. prompt_adapter_id: int
  10. prompt_adapter_local_path: str
  11. prompt_adapter_num_virtual_tokens: int
  12. def __hash__(self):
  13. return super().__hash__()
  14. @property
  15. def adapter_id(self):
  16. return self.prompt_adapter_id
  17. @property
  18. def name(self):
  19. return self.prompt_adapter_name
  20. @property
  21. def local_path(self):
  22. return self.prompt_adapter_local_path