mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-04-21 14:52:20 +00:00
* wip(gaudi): import server and dockerfile from tgi-gaudi fork * feat(gaudi): new gaudi backend working * fix: fix style * fix prehooks issues * fix(gaudi): refactor server and implement requested changes
16 lines
281 B
Python
16 lines
281 B
Python
from functools import lru_cache
|
|
from text_generation_server.utils.dist import RANK
|
|
|
|
|
|
@lru_cache(10)
|
|
def log_once(log, msg: str, master=True):
|
|
if master:
|
|
log_master(log, msg)
|
|
else:
|
|
log(msg)
|
|
|
|
|
|
def log_master(log, msg: str):
|
|
if RANK == 0:
|
|
log(msg)
|