Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
norm
vllm
Commits
5e644b91
Commit
5e644b91
authored
Feb 09, 2023
by
Woosuk Kwon
Browse files
Add utils
parent
d904350a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
cacheflow/utils.py
cacheflow/utils.py
+20
-0
No files found.
cacheflow/utils.py
0 → 100644
View file @
5e644b91
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment