mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-12 04:44:52 +00:00
fix: set sharded true if WORLD_SIZE is set
This commit is contained in:
parent
cdbf802860
commit
9854f20225
@ -44,6 +44,9 @@ def serve(
|
|||||||
otlp_endpoint: Optional[str] = None,
|
otlp_endpoint: Optional[str] = None,
|
||||||
max_input_tokens: Optional[int] = None,
|
max_input_tokens: Optional[int] = None,
|
||||||
):
|
):
|
||||||
|
# derive sharded from environment variables if not provided
|
||||||
|
sharded = sharded or os.getenv("WORLD_SIZE", None) is not None
|
||||||
|
|
||||||
if sharded:
|
if sharded:
|
||||||
assert (
|
assert (
|
||||||
os.getenv("RANK", None) is not None
|
os.getenv("RANK", None) is not None
|
||||||
|
Loading…
Reference in New Issue
Block a user