From 6bb3f54e396e4dd20a6f3ed71463a52d567b6d5e Mon Sep 17 00:00:00 2001 From: Alexander Borzunov Date: Wed, 30 Aug 2023 23:31:39 +0400 Subject: [PATCH] Replace dots in repo names when building DHT prefixes (#489) --- src/petals/models/bloom/config.py | 1 + src/petals/models/llama/config.py | 1 + 2 files changed, 2 insertions(+) diff --git a/src/petals/models/bloom/config.py b/src/petals/models/bloom/config.py index cc5c839..cda4cf7 100644 --- a/src/petals/models/bloom/config.py +++ b/src/petals/models/bloom/config.py @@ -30,5 +30,6 @@ class DistributedBloomConfig(BloomConfig, ClientConfig, PTuneConfig, LMHeadConfi if loading_from_repo and dht_prefix is None: # We need "-petals" for backward compatibility with Petals < 1.2.0 dht_prefix = str(model_name_or_path) + "-petals" + dht_prefix = dht_prefix.replace(".", "-") logger.info(f"Using DHT prefix: {dht_prefix}") return super().from_pretrained(model_name_or_path, *args, dht_prefix=dht_prefix, **kwargs) diff --git a/src/petals/models/llama/config.py b/src/petals/models/llama/config.py index c5144c2..43a5843 100644 --- a/src/petals/models/llama/config.py +++ b/src/petals/models/llama/config.py @@ -35,6 +35,7 @@ class DistributedLlamaConfig(LlamaConfig, ClientConfig, PTuneConfig, LMHeadConfi if loading_from_repo and dht_prefix is None: dht_prefix = str(model_name_or_path) dht_prefix = dht_prefix.split("/")[-1] # Use only repo name to merge blocks hosted by different accounts + dht_prefix = dht_prefix.replace(".", "-") if not dht_prefix.endswith("-hf"): dht_prefix += "-hf" logger.info(f"Using DHT prefix: {dht_prefix}")