Skip to content

Commit

Permalink
Show license links when loading models
Browse files Browse the repository at this point in the history
  • Loading branch information
borzunov committed Jun 24, 2023
1 parent 47a2b1e commit baf56b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/petals/models/bloom/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class DistributedBloomConfig(BloomConfig, SequenceManagerConfig, PTuneConfig, LM
def from_pretrained(
cls, model_name_or_path: Union[str, os.PathLike, None], *args, dht_prefix: Optional[str] = None, **kwargs
):
logger.info("Make sure you follow the BLOOM's terms of use: https://bit.ly/bloom-license")

loading_from_repo = model_name_or_path is not None and not os.path.isdir(model_name_or_path)
if loading_from_repo and dht_prefix is None:
# We need "-petals" for backward compatibility with Petals < 1.2.0
Expand Down
5 changes: 5 additions & 0 deletions src/petals/models/llama/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ class DistributedLlamaConfig(LlamaConfig, SequenceManagerConfig, PTuneConfig, LM
def from_pretrained(
cls, model_name_or_path: Union[str, os.PathLike, None], *args, dht_prefix: Optional[str] = None, **kwargs
):
logger.info(
"LLaMA is available solely for non-commercial research purposes. "
"Make sure you follow the terms of use: https://bit.ly/llama-license"
)

loading_from_repo = model_name_or_path is not None and not os.path.isdir(model_name_or_path)
if loading_from_repo and dht_prefix is None:
dht_prefix = str(model_name_or_path)
Expand Down

0 comments on commit baf56b4

Please sign in to comment.