Skip to content

Commit 6bb3f54

Browse files
authored
Replace dots in repo names when building DHT prefixes (#489)
1 parent 02fc71e commit 6bb3f54

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/petals/models/bloom/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ def from_pretrained(
3030
if loading_from_repo and dht_prefix is None:
3131
# We need "-petals" for backward compatibility with Petals < 1.2.0
3232
dht_prefix = str(model_name_or_path) + "-petals"
33+
dht_prefix = dht_prefix.replace(".", "-")
3334
logger.info(f"Using DHT prefix: {dht_prefix}")
3435
return super().from_pretrained(model_name_or_path, *args, dht_prefix=dht_prefix, **kwargs)

src/petals/models/llama/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def from_pretrained(
3535
if loading_from_repo and dht_prefix is None:
3636
dht_prefix = str(model_name_or_path)
3737
dht_prefix = dht_prefix.split("/")[-1] # Use only repo name to merge blocks hosted by different accounts
38+
dht_prefix = dht_prefix.replace(".", "-")
3839
if not dht_prefix.endswith("-hf"):
3940
dht_prefix += "-hf"
4041
logger.info(f"Using DHT prefix: {dht_prefix}")

0 commit comments

Comments
 (0)