Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix routing through relay, default network RPS, --token, logging, readme #399

Merged
merged 10 commits into from
Jul 22, 2023
Prev Previous commit
Next Next commit
Use .from_pretrained(..., use_auth_token=token) instead of token=token
until it's fully supported across HF libs
  • Loading branch information
borzunov committed Jul 22, 2023
commit 519d6b73b0388f55b253fdfc90136e6054d9a443
2 changes: 1 addition & 1 deletion src/petals/server/from_pretrained.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def load_pretrained_block(
max_disk_space: Optional[int] = None,
) -> nn.Module:
if config is None:
config = AutoDistributedConfig.from_pretrained(model_name, token=token)
config = AutoDistributedConfig.from_pretrained(model_name, use_auth_token=token)
if cache_dir is None:
cache_dir = DEFAULT_CACHE_DIR

Expand Down
2 changes: 1 addition & 1 deletion src/petals/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def __init__(

self.block_config = AutoDistributedConfig.from_pretrained(
converted_model_name_or_path,
token=token,
use_auth_token=token,
revision=revision,
)

Expand Down
8 changes: 6 additions & 2 deletions src/petals/utils/auto_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ class _AutoDistributedBase:

@classmethod
def from_pretrained(cls, model_name_or_path: Union[str, os.PathLike, None], *args, **kwargs) -> PretrainedConfig:
if always_needs_auth(model_name_or_path) and "token" not in kwargs and "use_auth_token" not in kwargs:
kwargs["token"] = True
if (
always_needs_auth(model_name_or_path)
and kwargs.get("token") is None
and kwargs.get("use_auth_token") is None
):
kwargs["use_auth_token"] = True

config = AutoConfig.from_pretrained(model_name_or_path, *args, **kwargs)
if config.model_type not in _CLASS_MAPPING:
Expand Down
25 changes: 0 additions & 25 deletions tests/scripts/remove_old_models.py

This file was deleted.

Loading