mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-10 00:35:28 +08:00
21 lines
335 B
Python
21 lines
335 B
Python
import enum
|
|
|
|
|
|
class Device(enum.Enum):
|
|
GPU = enum.auto()
|
|
CPU = enum.auto()
|
|
|
|
|
|
class Counter:
|
|
|
|
def __init__(self, start: int = 0) -> None:
|
|
self.counter = start
|
|
|
|
def __next__(self) -> int:
|
|
id = self.counter
|
|
self.counter += 1
|
|
return id
|
|
|
|
def reset(self) -> None:
|
|
self.counter = 0
|