NeonBohdan commited on
Commit
4bb483c
1 Parent(s): 2e517b5

No revision -> no personas

Browse files
Files changed (1) hide show
  1. shared.py +10 -8
shared.py CHANGED
@@ -68,14 +68,16 @@ class Client:
68
  self.revision = revision
69
 
70
  def get_personas(self):
71
- try:
72
- config_path = hf_hub_download(self.model_name, "config.yaml",
73
- subfolder="datasets",
74
- revision=self.revision)
75
- self.config = ModelConfig.from_yaml(config_path)
76
- personas = self.config.pile.persona2system
77
- except EntryNotFoundError:
78
- personas = {}
 
 
79
 
80
  personas["default"] = None
81
  self.personas = self.input_personas | personas
 
68
  self.revision = revision
69
 
70
  def get_personas(self):
71
+ personas = {}
72
+ if self.revision is not None:
73
+ try:
74
+ config_path = hf_hub_download(self.model_name, "config.yaml",
75
+ subfolder="datasets",
76
+ revision=self.revision)
77
+ self.config = ModelConfig.from_yaml(config_path)
78
+ personas = self.config.pile.persona2system
79
+ except EntryNotFoundError:
80
+ pass
81
 
82
  personas["default"] = None
83
  self.personas = self.input_personas | personas