Sfoglia il codice sorgente

Show license links when loading models (#332)

Alexander Borzunov 2 anni fa
parent
commit
fecee8c4dc
2 ha cambiato i file con 7 aggiunte e 0 eliminazioni
  1. 2 0
      src/petals/models/bloom/config.py
  2. 5 0
      src/petals/models/llama/config.py

+ 2 - 0
src/petals/models/bloom/config.py

@@ -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

+ 5 - 0
src/petals/models/llama/config.py

@@ -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)