request.py 710 B

12345678910111213141516171819202122232425262728293031323334
  1. import msgspec
  2. from aphrodite.adapter_commons.request import AdapterRequest
  3. class PromptAdapterRequest(
  4. msgspec.Struct,
  5. array_like=True,
  6. omit_defaults=True,
  7. frozen=True):
  8. """
  9. Request for a Prompt adapter.
  10. """
  11. __metaclass__ = AdapterRequest
  12. prompt_adapter_name: str
  13. prompt_adapter_id: int
  14. prompt_adapter_local_path: str
  15. prompt_adapter_num_virtual_tokens: int
  16. def __hash__(self):
  17. return super().__hash__()
  18. @property
  19. def adapter_id(self):
  20. return self.prompt_adapter_id
  21. @property
  22. def name(self):
  23. return self.prompt_adapter_name
  24. @property
  25. def local_path(self):
  26. return self.prompt_adapter_local_path